diff options
author | Matt Friedman <maf675@gmail.com> | 2013-10-20 14:30:29 -0700 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2013-10-20 14:30:29 -0700 |
commit | 3c38f4e20a3efc035d5cf6f56ab9901150a10331 (patch) | |
tree | d18c28388b4c178183685e50a3cbe12b0828cc3c /phpBB/assets/javascript/core.js | |
parent | cc4219159831b38232064bb63cb6c9a7ff851dc4 (diff) | |
parent | eda35d15f8b140f878c5e9fb91b0b4e47219a181 (diff) | |
download | forums-3c38f4e20a3efc035d5cf6f56ab9901150a10331.tar forums-3c38f4e20a3efc035d5cf6f56ab9901150a10331.tar.gz forums-3c38f4e20a3efc035d5cf6f56ab9901150a10331.tar.bz2 forums-3c38f4e20a3efc035d5cf6f56ab9901150a10331.tar.xz forums-3c38f4e20a3efc035d5cf6f56ab9901150a10331.zip |
[ticket/11936] Merge branch 'develop' into ticket/11936
PHPBB3-11936
Diffstat (limited to 'phpBB/assets/javascript/core.js')
-rw-r--r-- | phpBB/assets/javascript/core.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index cdba6f9d26..ab0891e70c 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -510,11 +510,11 @@ $('#notification_list_button').click(function(e) { e.preventDefault(); }); $('#phpbb').click(function(e) { - var target = $(e.target); + var target = $(e.target); - if (!target.is('#notification_list') && !target.is('#notification_list_button') && !target.parents().is('#notification_list')) { - $('#notification_list').hide(); - } + if (!target.is('#notification_list, #notification_list_button') && !target.parents().is('#notification_list, #notification_list_button')) { + $('#notification_list').hide(); + } }); phpbb.ajaxCallbacks = {}; @@ -624,8 +624,7 @@ phpbb.resizeTextArea = function(items, options) { function resetAutoResize(item) { var $item = $(item); - if ($item.hasClass('auto-resized')) - { + if ($item.hasClass('auto-resized')) { $(item).css({height: '', resize: ''}).removeClass('auto-resized'); configuration.resetCallback.call(item, $item); } @@ -635,14 +634,14 @@ phpbb.resizeTextArea = function(items, options) { { function setHeight(height) { + height += parseInt($item.css('height')) - $item.height(); $item.css({height: height + 'px', resize: 'none'}).addClass('auto-resized'); configuration.resizeCallback.call(item, $item); } var windowHeight = $(window).height(); - if (windowHeight < configuration.minWindowHeight) - { + if (windowHeight < configuration.minWindowHeight) { resetAutoResize(item); return; } @@ -652,12 +651,14 @@ phpbb.resizeTextArea = function(items, options) { height = parseInt($item.height()), scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0; - if (height > maxHeight) - { + if (height < 0) { + return; + } + + if (height > maxHeight) { setHeight(maxHeight); } - else if (scrollHeight > (height + 5)) - { + else if (scrollHeight > (height + 5)) { setHeight(Math.min(maxHeight, scrollHeight)); } } @@ -670,8 +671,7 @@ phpbb.resizeTextArea = function(items, options) { $(window).resize(function() { items.each(function() { - if ($(this).hasClass('auto-resized')) - { + if ($(this).hasClass('auto-resized')) { autoResize(this); } }); |