summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-05-20 07:59:53 +0300
committerAndrew Dolgov <[email protected]>2019-05-20 07:59:53 +0300
commit905f0386101512822cb145b6c9dfec5658565ff9 (patch)
treed9df63df506b4fdd9075742d06cfba3ccfc17280 /js
parent09f520eda2f8ace131335c5a2837e712d4687dc8 (diff)
search dialog: display active query if searching already
Diffstat (limited to 'js')
-rw-r--r--js/Feeds.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/Feeds.js b/js/Feeds.js
index cb3cc3612..459ccc4dd 100644
--- a/js/Feeds.js
+++ b/js/Feeds.js
@@ -552,6 +552,11 @@ define(["dojo/_base/declare"], function (declare) {
execute: function () {
if (this.validate()) {
Feeds._search_query = this.attr('value');
+
+ // disallow empty queries
+ if (!Feeds._search_query.query)
+ Feeds._search_query = false;
+
this.hide();
Feeds.reloadCurrent();
}
@@ -559,6 +564,23 @@ define(["dojo/_base/declare"], function (declare) {
href: query
});
+ const tmph = dojo.connect(dialog, 'onLoad', function () {
+ dojo.disconnect(tmph);
+
+ console.log('S_onload');
+
+ if (Feeds._search_query) {
+ if (Feeds._search_query.query)
+ dijit.byId('search_query')
+ .attr('value', Feeds._search_query.query);
+
+ if (Feeds._search_query.search_language)
+ dijit.byId('search_language')
+ .attr('value', Feeds._search_query.search_language);
+ }
+
+ });
+
dialog.show();
},
updateRandom: function() {