summaryrefslogtreecommitdiff
path: root/overrides/endless_private/search_box.js
diff options
context:
space:
mode:
authorMatt Watson <mattdangerw@gmail.com>2015-08-03 15:46:28 -0700
committerMatt Watson <mattdangerw@gmail.com>2015-08-06 14:01:54 -0700
commitb867b717bb94804427cc4bba6b54c485cb92c352 (patch)
treefdcd6501aca7540ec4c7f23b8981ab83f47d0f77 /overrides/endless_private/search_box.js
parent259f874fa34bf68c085eb7a404c2dec9d622dc14 (diff)
search_box: add function to set text programmatically
This way we can set the search box text without triggering the signals for settings autocomplete entries [endlessm/eos-sdk#3442]
Diffstat (limited to 'overrides/endless_private/search_box.js')
-rw-r--r--overrides/endless_private/search_box.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/overrides/endless_private/search_box.js b/overrides/endless_private/search_box.js
index ea45531..f076962 100644
--- a/overrides/endless_private/search_box.js
+++ b/overrides/endless_private/search_box.js
@@ -141,6 +141,16 @@ const SearchBox = new Lang.Class({
return Gdk.EVENT_STOP;
},
+ /* Set the entry text without triggering the text-changed signal.
+ */
+ set_text_programmatically: function (text) {
+ if (this.text === text)
+ return;
+ this._entry_changed_by_widget = true;
+ this.text = text;
+ this.set_position(-1);
+ },
+
/* Set the menu items by providing an array of item objects:
[
{