default password warning: fix close button, don't crash if dialog is recreated (on feed tree reload etc)

This commit is contained in:
Andrew Dolgov 2020-01-25 13:02:11 +03:00
parent 0e9e1ad112
commit 776fe4768b
2 changed files with 4 additions and 1 deletions

View File

@ -199,7 +199,7 @@ class Dlg extends Handler_Protected {
print "<button dojoType='dijit.form.Button' onclick=\"document.location.href = 'prefs.php'\">". print "<button dojoType='dijit.form.Button' onclick=\"document.location.href = 'prefs.php'\">".
__('Open Preferences')."</button> "; __('Open Preferences')."</button> ";
print "<button dojoType='dijit.form.Button' print "<button dojoType='dijit.form.Button'
onclick=\"return CommonDialogs.closeInfoBox()\">". onclick=\"return dijit.byId('defaultPasswordDlg').hide();\">".
__('Close this window')."</button>"; __('Close this window')."</button>";
print "</footeer>"; print "</footeer>";
} }

View File

@ -221,6 +221,9 @@ define(["dojo/_base/declare"], function (declare) {
if (App.getInitParam("is_default_pw")) { if (App.getInitParam("is_default_pw")) {
console.warn("user password is at default value"); console.warn("user password is at default value");
if (dijit.byId("defaultPasswordDlg"))
dijit.byId("defaultPasswordDlg").destroyRecursive();
const dialog = new dijit.Dialog({ const dialog = new dijit.Dialog({
title: __("Your password is at default value"), title: __("Your password is at default value"),
href: "backend.php?op=dlg&method=defaultpasswordwarning", href: "backend.php?op=dlg&method=defaultpasswordwarning",