1
0
mirror of synced 2024-11-25 22:36:03 +03:00

Merge pull request #2044 from sieppl/master

singleSelect: setting nextSearchTerm in initSelection
This commit is contained in:
Kevin Brown 2014-01-19 13:04:00 -08:00
commit d5cb4bfa1c

View File

@ -762,6 +762,8 @@ the specific language governing permissions and limitations under the Apache Lic
// dom it will trigger the popup close, which is not what we want // dom it will trigger the popup close, which is not what we want
this.dropdown.on("click mouseup mousedown", function (e) { e.stopPropagation(); }); this.dropdown.on("click mouseup mousedown", function (e) { e.stopPropagation(); });
this.nextSearchTerm = undefined;
if ($.isFunction(this.opts.initSelection)) { if ($.isFunction(this.opts.initSelection)) {
// initialize selection based on the current value of the source element // initialize selection based on the current value of the source element
this.initSelection(); this.initSelection();
@ -789,8 +791,7 @@ the specific language governing permissions and limitations under the Apache Lic
this.autofocus = opts.element.prop("autofocus"); this.autofocus = opts.element.prop("autofocus");
opts.element.prop("autofocus", false); opts.element.prop("autofocus", false);
if (this.autofocus) this.focus(); if (this.autofocus) this.focus();
this.nextSearchTerm = undefined;
}, },
// abstract // abstract
@ -2144,9 +2145,10 @@ the specific language governing permissions and limitations under the Apache Lic
self.updateSelection(selected); self.updateSelection(selected);
self.close(); self.close();
self.setPlaceholder(); self.setPlaceholder();
self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val());
} }
}); });
} }
}, },
isPlaceholderOptionSelected: function() { isPlaceholderOptionSelected: function() {