From bd3bf8f45a32c014a666fabcb59020f7324b9bb4 Mon Sep 17 00:00:00 2001 From: Jack Moore Date: Fri, 23 Mar 2018 15:39:15 -0400 Subject: [PATCH] minor refactor --- changelog.md | 3 +++ dist/autosize.js | 17 ++++++----------- dist/autosize.min.js | 4 ++-- package.json | 2 +- src/autosize.js | 15 +++++---------- 5 files changed, 17 insertions(+), 24 deletions(-) diff --git a/changelog.md b/changelog.md index 023ecb7..cea61c0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ ## Changelog +##### v.4.0.1 - 2018-03-23 +* Minor refactor & updated build depedencies + ##### v.4.0.0 - 2017-07-12 * Changed how Autosize determines the inital height. Fixes #336. diff --git a/dist/autosize.js b/dist/autosize.js index f251c36..78f314c 100644 --- a/dist/autosize.js +++ b/dist/autosize.js @@ -1,5 +1,5 @@ /*! - autosize 4.0.0 + autosize 4.0.1 license: MIT http://www.jacklmoore.com/autosize */ @@ -122,21 +122,16 @@ } function resize() { - var originalHeight = ta.style.height; - var overflows = getParentOverflows(ta); - var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240) - - ta.style.height = ''; - - var endHeight = ta.scrollHeight + heightOffset; - if (ta.scrollHeight === 0) { // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM. - ta.style.height = originalHeight; return; } - ta.style.height = endHeight + 'px'; + var overflows = getParentOverflows(ta); + var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240) + + ta.style.height = ''; + ta.style.height = ta.scrollHeight + heightOffset + 'px'; // used to check if an update is actually necessary on window.resize clientWidth = ta.clientWidth; diff --git a/dist/autosize.min.js b/dist/autosize.min.js index 4e93616..0551d5b 100644 --- a/dist/autosize.min.js +++ b/dist/autosize.min.js @@ -1,6 +1,6 @@ /*! - autosize 4.0.0 + autosize 4.0.1 license: MIT http://www.jacklmoore.com/autosize */ -!function(e,t){if("function"==typeof define&&define.amd)define(["module","exports"],t);else if("undefined"!=typeof exports)t(module,exports);else{var n={exports:{}};t(n,n.exports),e.autosize=n.exports}}(this,function(e,t){"use strict";var n,o,p="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return-1