diff options
author | Isaac Bennetch <bennetch@gmail.com> | 2015-06-01 21:50:04 +0300 |
---|---|---|
committer | Isaac Bennetch <bennetch@gmail.com> | 2015-06-01 21:50:04 +0300 |
commit | af658d27ee6d854e4535504aeca8a1aceb30be4f (patch) | |
tree | 2ff49fa2ba7003c02cc4fbf54ab0fe462992f05c /js/db_structure.js | |
parent | 1953235c025bbba30bbf5b6b7bd04694cd6c986b (diff) | |
parent | aeae86d7cc097a24f532a9d35ad32f3e760efee9 (diff) |
Merge pull request #1708 from devenbansod/rfe701_using_css
RFE#701 - Print View using CSS - Rewrite
Diffstat (limited to 'js/db_structure.js')
-rw-r--r-- | js/db_structure.js | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/js/db_structure.js b/js/db_structure.js index e80d9e1df6..ab611bece4 100644 --- a/js/db_structure.js +++ b/js/db_structure.js @@ -26,6 +26,7 @@ AJAX.registerTeardown('db_structure.js', function () { $(document).off('click', "a.drop_table_anchor.ajax"); $(document).off('click', '#real_end_input'); $(document).off('click', "a.favorite_table_anchor.ajax"); + $(document).off('click', '#printView'); $('a.real_row_count').off('click'); $('a.row_count_sum').off('click'); $('select[name=submit_mult]').unbind('change'); @@ -182,31 +183,6 @@ function PMA_fetchRealRowCount($target) } AJAX.registerOnload('db_structure.js', function () { - /** - * Handler for the print view multisubmit. - * All other multi submits can be handled via ajax, but this one needs - * special treatment as the results need to open in another browser window - */ - $('#tablesForm').submit(function (event) { - var $form = $(this); - if ($form.find('select[name=submit_mult]').val() === 'print') { - event.preventDefault(); - event.stopPropagation(); - $('form#clone').remove(); - var $clone = $form - .clone() - .hide() - .appendTo('body'); - $clone - .find('select[name=submit_mult]') - .val('print'); - $clone - .attr('target', 'printview') - .attr('id', 'clone') - .submit(); - } - }); - /** * function to open the confirmation dialog for making table consistent with central list * @@ -349,6 +325,16 @@ AJAX.registerOnload('db_structure.js', function () { }); // end $.PMA_confirm() }); //end of Drop Table Ajax action + /** + * Attach Event Handler for 'Print View' + */ + $(document).on('click', "#printView", function (event) { + event.preventDefault(); + + // Print the page + printPage(); + }); //end of Print View action + //Calculate Real End for InnoDB /** * Ajax Event handler for calculating the real end for a InnoDB table |