Fix #15720 - added markUnsaved function

Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com>
This commit is contained in:
Yash Bothra 2020-01-01 22:16:04 +01:00 committed by William Desportes
parent b314a477d5
commit 1470761a8f
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
2 changed files with 7 additions and 3 deletions

View File

@ -529,6 +529,8 @@ DesignerMove.addTableToTablesList = function (index, tableDom) {
var table = $(tableDom).find('.small_tab_pref').attr('table_name');
var dbEncoded = $(tableDom).find('.small_tab_pref').attr('db_url');
var tableEncoded = $(tableDom).find('.small_tab_pref').attr('table_name_url');
var tableIsChecked = $(tableDom).css('display') === "block" ? "checked" : "";
var checkboxStatus = (tableIsChecked === "checked") ? Messages.strHide : Messages.strShow;
var $newTableLine = $('<tr>' +
' <td title="' + Messages.strStructure + '"' +
' width="1px"' +
@ -541,12 +543,11 @@ DesignerMove.addTableToTablesList = function (index, tableDom) {
' </td>' +
' <td width="1px">' +
' <input class="scroll_tab_checkbox"' +
' title="' + Messages.strHide + '"' +
' title="' + checkboxStatus + '"' +
' id="check_vis_' + dbEncoded + '.' + tableEncoded + '"' +
' style="margin:0;"' +
' type="checkbox"' +
' value="' + dbEncoded + '.' + tableEncoded + '"' +
' checked="checked"' +
' value="' + dbEncoded + '.' + tableEncoded + '"' + tableIsChecked +
' />' +
' </td>' +
' <td class="designer_Tabs"' +
@ -560,6 +561,7 @@ DesignerMove.addTableToTablesList = function (index, tableDom) {
DesignerMove.selectTab($(this).attr('designer_url_table_name'));
});
$($newTableLine).find('.scroll_tab_checkbox').click(function () {
$(this).attr('title', function(i, currentvalue) { return currentvalue === Messages.strHide ? Messages.strShow : Messages.strHide });
DesignerMove.visibleTab(this,$(this).val());
});
var $tablesCounter = $('#tables_counter');
@ -1590,6 +1592,7 @@ DesignerMove.visibleTab = function (id, tN) {
document.getElementById(tN).style.display = 'none';
}
DesignerMove.reload();
DesignerMove.markUnsaved();
};
// max/min all tables

View File

@ -765,6 +765,7 @@ $js_messages['strU2FError'] = __('Failed security key activation (%s).');
/* Designer */
$js_messages['strTableAlreadyExists'] = _pgettext('The table already exists in the designer and can not be added once more.', 'Table %s already exists!');
$js_messages['strHide'] = __('Hide');
$js_messages['strShow'] = __('Show');
$js_messages['strStructure'] = __('Structure');
echo "var Messages = [];\n";