diff options
author | Marc Delisle <marc@infomarc.info> | 2014-06-09 20:27:40 +0400 |
---|---|---|
committer | Marc Delisle <marc@infomarc.info> | 2014-06-09 20:27:40 +0400 |
commit | 00bad7150b9afd99d4535ec18ec6c4db444c27bc (patch) | |
tree | 18cb9b25406f676fea3ac2984371a7b7863d544c /js/db_structure.js | |
parent | 96c45667f9c4ca004874195685fc9765ab3de666 (diff) | |
parent | 6b8575734c7a981dad5bfc716aa020b99c3fcb5f (diff) |
Merge pull request #1211 from smita786/gsoc_central_columns_list
option to Make table consistent with central list of columns
Diffstat (limited to 'js/db_structure.js')
-rw-r--r-- | js/db_structure.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/js/db_structure.js b/js/db_structure.js index 6145486f3e..fca48a4bbc 100644 --- a/js/db_structure.js +++ b/js/db_structure.js @@ -31,6 +31,7 @@ AJAX.registerTeardown('db_structure.js', function () { $("a.favorite_table_anchor.ajax").die('click'); $('a.real_row_count').off('click'); $('a.row_count_sum').off('click'); + $('select[name=submit_mult]').unbind('change'); }); /** @@ -205,6 +206,46 @@ AJAX.registerOnload('db_structure.js', function () { } }); +/** + * function to open the confirmation dialog for making table consistent with central list + * + * @param string msg message text to be displayedd to user + * @param function success function to be called on success + * + */ + var jqConfirm = function(msg, success) { + var dialogObj = $("<div style='display:none'>"+msg+"</div>"); + $('body').append(dialogObj); + var buttonOptions = {}; + buttonOptions[PMA_messages.strContinue] = function () { + success(); + $( this ).dialog( "close" ); + }; + buttonOptions[PMA_messages.strCancel] = function () { + $( this ).dialog( "close" ); + $('#tablesForm')[0].reset(); + }; + $(dialogObj).dialog({ + resizable: false, + modal: true, + title: PMA_messages.confirmTitle, + buttons: buttonOptions + }); + }; + +/** + * Event handler on select of "Make consistent with central list" + */ + $('select[name=submit_mult]').change(function(event) { + if($(this).val() === 'make_consistent_with_central_list') { + event.preventDefault(); + event.stopPropagation(); + jqConfirm(PMA_messages.makeConsistentMessage, function(){ + $('#tablesForm').submit(); + }); + return false; + } + }); /** * Event handler for 'Foreign Key Checks' disabling option * in the drop table confirmation form |