aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/assets')
-rw-r--r--phpBB/assets/javascript/core.js28
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);
}
});