Fix: Don't show 'reset to default' if there is no config in localstorage
This commit is contained in:
parent
ca94b919ac
commit
1120bb597a
@ -573,6 +573,7 @@ $(function() {
|
||||
$('a[href="#clearMonitorConfig"]').click(function() {
|
||||
window.localStorage.removeItem('monitorCharts');
|
||||
window.localStorage.removeItem('monitorSettings');
|
||||
window.localStorage.removeItem('monitorVersion');
|
||||
$(this).hide();
|
||||
rebuildGrid();
|
||||
});
|
||||
@ -832,7 +833,7 @@ $(function() {
|
||||
var series;
|
||||
|
||||
/* Apply default values & config */
|
||||
if (window.localStorage && monitorProtocolVersion == window.localStorage['monitorVersion']) {
|
||||
if (window.localStorage) {
|
||||
if (window.localStorage['monitorCharts']) {
|
||||
runtime.charts = $.parseJSON(window.localStorage['monitorCharts']);
|
||||
}
|
||||
@ -841,19 +842,19 @@ $(function() {
|
||||
}
|
||||
|
||||
$('a[href="#clearMonitorConfig"]').toggle(runtime.charts != null);
|
||||
}
|
||||
|
||||
if (window.localStorage && window.localStorage['monitorCharts'] && monitorProtocolVersion != window.localStorage['monitorVersion']) {
|
||||
$('div#emptyDialog').attr('title',PMA_messages['strIncompatibleMonitorConfig']);
|
||||
$('div#emptyDialog').html(PMA_messages['strIncompatibleMonitorConfigDescription']);
|
||||
|
||||
var dlgBtns = {};
|
||||
dlgBtns[PMA_messages['strClose']] = function() { $(this).dialog('close'); };
|
||||
|
||||
$('div#emptyDialog').dialog({
|
||||
width: 400,
|
||||
buttons: dlgBtns
|
||||
});
|
||||
|
||||
if (runtime.charts != null && monitorProtocolVersion != window.localStorage['monitorVersion']) {
|
||||
$('div#emptyDialog').attr('title',PMA_messages['strIncompatibleMonitorConfig']);
|
||||
$('div#emptyDialog').html(PMA_messages['strIncompatibleMonitorConfigDescription']);
|
||||
|
||||
var dlgBtns = {};
|
||||
dlgBtns[PMA_messages['strClose']] = function() { $(this).dialog('close'); };
|
||||
|
||||
$('div#emptyDialog').dialog({
|
||||
width: 400,
|
||||
buttons: dlgBtns
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (runtime.charts == null) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user