1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/13887] Minor JS refactoring

PHPBB3-13887
This commit is contained in:
Callum Macrae
2015-05-29 12:51:28 +02:00
parent 2a83290e7c
commit 143578ad09
5 changed files with 63 additions and 58 deletions

View File

@@ -138,9 +138,9 @@ phpbb.markNotifications = function($popup, unreadCount) {
}
// Update page title
$('title').text(
(unreadCount ? '(' + unreadCount + ')' : '') + $('title').text().replace(/(\(([0-9])\))/, '')
);
var $title = $('title');
var originalTitle = $title.text().replace(/(\((\d+)\))/, '');
$title.text((unreadCount ? '(' + unreadCount + ')' : '') + originalTitle);
};
// This callback finds the post from the delete link, and removes it.
@@ -205,7 +205,7 @@ phpbb.addAjaxCallback('vote_poll', function(res) {
// Set min-height to prevent the page from jumping when the content changes
var updatePanelHeight = function (height) {
var height = (typeof height === 'undefined') ? panel.find('.inner').outerHeight() : height;
height = (typeof height === 'undefined') ? panel.find('.inner').outerHeight() : height;
panel.css('min-height', height);
};
updatePanelHeight();
@@ -378,7 +378,7 @@ $('#member_search').click(function () {
*/
$(function() {
phpbb.resizeTextArea($('textarea:not(#message-box textarea, .no-auto-resize)'), {minHeight: 75, maxHeight: 250});
phpbb.resizeTextArea($('#message-box textarea'));
phpbb.resizeTextArea($('textarea', '#message-box'));
});