diff options
author | Hugues Peccatte <hugues.peccatte@gmail.com> | 2015-07-21 00:43:53 +0300 |
---|---|---|
committer | Hugues Peccatte <hugues.peccatte@gmail.com> | 2015-07-21 00:43:53 +0300 |
commit | 84ebb98e544b5b185e180b384f12bcebdcec8319 (patch) | |
tree | 42bdfa89bf618303991623ea2fd431f117952b02 | |
parent | e1696fe7d66417934cb9cdc4c46c91962c70cf96 (diff) |
Remove duplicate CSS selectors.
Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
-rw-r--r-- | js/ajax.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/js/ajax.js b/js/ajax.js index a4d0cc09d9..2bff5a23bb 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -390,12 +390,13 @@ var AJAX = { .not('#pma_console_container') .not('#prefs_autoload') .remove(); + var $page_content = $('#page_content'); // Replace #page_content with new content if (data.message && data.message.length > 0) { - $('#page_content').replaceWith( + $page_content.replaceWith( "<div id='page_content'>" + data.message + "</div>" ); - PMA_highlightSQL($('#page_content')); + PMA_highlightSQL($page_content); checkNumberOfFields(); } @@ -431,8 +432,8 @@ var AJAX = { PMA_commonParams.setAll(data._params); } if (data._displayMessage) { - $('#page_content').prepend(data._displayMessage); - PMA_highlightSQL($('#page_content')); + $page_content.prepend(data._displayMessage); + PMA_highlightSQL($page_content); } $('#pma_errors').remove(); @@ -650,11 +651,12 @@ AJAX.registerOnload('functions.js', function () { } }); + var $page_content = $('#page_content'); /** * Workaround for passing submit button name,value on ajax form submit * by appending hidden element with submit button name and value. */ - $("#page_content").on('click', 'form input[type=submit]', function() { + $page_content.on('click', 'form input[type=submit]', function() { var buttonName = $(this).attr('name'); if (typeof buttonName === 'undefined') { return; @@ -670,7 +672,7 @@ AJAX.registerOnload('functions.js', function () { * Attach event listener to events when user modify visible * Input,Textarea and select fields to make changes in forms */ - $('#page_content').on( + $page_content.on( 'keyup change', 'form.lock-page textarea, ' + 'form.lock-page input[type="text"], ' + @@ -679,7 +681,7 @@ AJAX.registerOnload('functions.js', function () { {value:1}, AJAX.lockPageHandler ); - $('#page_content').on( + $page_content.on( 'change', 'form.lock-page input[type="checkbox"], ' + 'form.lock-page input[type="radio"]', |