From 143578ad09e45e1d8a8abea0c718bf04043bed70 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Fri, 29 May 2015 12:51:28 +0200 Subject: [ticket/13887] Minor JS refactoring PHPBB3-13887 --- phpBB/styles/prosilver/template/ajax.js | 10 +++++----- phpBB/styles/subsilver2/template/posting_body.html | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'phpBB/styles') diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 85eb841c80..1d95fa42fa 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -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')); }); diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html index 815d8c4a99..cde6873a90 100644 --- a/phpBB/styles/subsilver2/template/posting_body.html +++ b/phpBB/styles/subsilver2/template/posting_body.html @@ -221,7 +221,7 @@ {L_ATTACHMENTS}{L_COLON} -   +   -- cgit v1.2.1