rework a few more dialogs to use App.dialogOf()

This commit is contained in:
Andrew Dolgov 2021-02-12 09:56:27 +03:00
parent d466284fab
commit 72e38bfe1f
5 changed files with 14 additions and 16 deletions

View File

@ -184,7 +184,7 @@ class Article extends Handler_Protected {
print "<button dojoType='dijit.form.Button' print "<button dojoType='dijit.form.Button'
type='submit' class='alt-primary'>".__('Save')."</button> "; type='submit' class='alt-primary'>".__('Save')."</button> ";
print "<button dojoType='dijit.form.Button' print "<button dojoType='dijit.form.Button'
onclick=\"dijit.byId('editTagsDlg').hide()\">".__('Cancel')."</button>"; onclick='App.dialogOf(this).hide()'>".__('Cancel')."</button>";
print "</footer>"; print "</footer>";
} }

View File

@ -83,8 +83,7 @@ class Backend extends Handler_Protected {
} }
print "<footer class='text-center'>"; print "<footer class='text-center'>";
print "<button dojoType='dijit.form.Button' print "<button dojoType='dijit.form.Button' class='alt-primary' type='submit'>".__('Close this window')."</button>";
onclick=\"return dijit.byId('helpDlg').hide()\">".__('Close this window')."</button>";
print "</footer>"; print "</footer>";
} }

View File

@ -730,9 +730,9 @@ class Feeds extends Handler_Protected {
print "<footer>"; print "<footer>";
print "<button dojoType='dijit.form.Button' class='alt-primary' type='submit' print "<button dojoType='dijit.form.Button' class='alt-primary' type='submit'
onclick=\"return dijit.byId('feedAddDlg').execute()\">".__('Subscribe')."</button>"; onclick=\"App.dialogOf(this).execute()\">".__('Subscribe')."</button>";
print "<button dojoType='dijit.form.Button' onclick=\"return dijit.byId('feedAddDlg').hide()\">".__('Cancel')."</button>"; print "<button dojoType='dijit.form.Button' onclick=\"App.dialogOf(this).hide()\">".__('Cancel')."</button>";
print "</footer>"; print "</footer>";
print "</form>"; print "</form>";
@ -744,7 +744,7 @@ class Feeds extends Handler_Protected {
$active_feed_id = sprintf("%d", $this->params[0]); $active_feed_id = sprintf("%d", $this->params[0]);
$is_cat = $this->params[1] != "false"; $is_cat = $this->params[1] != "false";
print "<form onsubmit='return false;'>"; print "<form onsubmit='return false'>";
print "<section>"; print "<section>";
@ -772,8 +772,9 @@ class Feeds extends Handler_Protected {
<i class='material-icons'>help</i> ".__("Search syntax")."</button>"; <i class='material-icons'>help</i> ".__("Search syntax")."</button>";
} }
print "<button dojoType='dijit.form.Button' type='submit' class='alt-primary' onclick=\"dijit.byId('searchDlg').execute()\">".__('Search')."</button> print "<button dojoType='dijit.form.Button' class='alt-primary'
<button dojoType='dijit.form.Button' onclick=\"dijit.byId('searchDlg').hide()\">".__('Cancel')."</button>"; type='submit' onclick='App.dialogOf(this).execute()'>".__('Search')."</button>
<button dojoType='dijit.form.Button' onclick='App.dialogOf(this).hide()'>".__('Cancel')."</button>";
print "</footer>"; print "</footer>";

View File

@ -809,8 +809,8 @@ class Pref_Feeds extends Handler_Protected {
print "<footer> print "<footer>
<button style='float : left' class='alt-danger' dojoType='dijit.form.Button' onclick='return CommonDialogs.unsubscribeFeed($feed_id, \"$title\")'>". <button style='float : left' class='alt-danger' dojoType='dijit.form.Button' onclick='return CommonDialogs.unsubscribeFeed($feed_id, \"$title\")'>".
__('Unsubscribe')."</button> __('Unsubscribe')."</button>
<button dojoType='dijit.form.Button' class='alt-primary' onclick=\"return dijit.byId('feedEditDlg').execute()\">".__('Save')."</button> <button dojoType='dijit.form.Button' class='alt-primary' type='submit'>".__('Save')."</button>
<button dojoType='dijit.form.Button' onclick=\"return dijit.byId('feedEditDlg').hide()\">".__('Cancel')."</button> <button dojoType='dijit.form.Button' onclick='App.dialogOf(this).hide()'>".__('Cancel')."</button>
</footer>"; </footer>";
} }
} }
@ -972,11 +972,10 @@ class Pref_Feeds extends Handler_Protected {
print "</section>"; print "</section>";
print "<footer> print "<footer>
<button dojoType='dijit.form.Button' type='submit' class='alt-primary' <button dojoType='dijit.form.Button' type='submit' class='alt-primary' type='submit'>".
onclick=\"return dijit.byId('feedEditDlg').execute()\">".
__('Save')."</button> __('Save')."</button>
<button dojoType='dijit.form.Button' <button dojoType='dijit.form.Button'
onclick=\"return dijit.byId('feedEditDlg').hide()\">". onclick=\"App.dialogOf(this).hide()\">".
__('Cancel')."</button> __('Cancel')."</button>
</footer>"; </footer>";

View File

@ -594,13 +594,12 @@ const Feeds = {
return tree.model.store.getValue(nuf, 'bare_id'); return tree.model.store.getValue(nuf, 'bare_id');
}, },
search: function() { search: function() {
if (dijit.byId("searchDlg"))
dijit.byId("searchDlg").destroyRecursive();
xhrPost("backend.php", xhrPost("backend.php",
{op: "feeds", method: "search", {op: "feeds", method: "search",
param: Feeds.getActive() + ":" + Feeds.activeIsCat()}, param: Feeds.getActive() + ":" + Feeds.activeIsCat()},
(transport) => { (transport) => {
if (dijit.byId("searchDlg"))
dijit.byId("searchDlg").destroyRecursive();
const dialog = new dijit.Dialog({ const dialog = new dijit.Dialog({
id: "searchDlg", id: "searchDlg",