1
0
mirror of synced 2024-11-22 21:16:10 +03:00

singleSelect: setting nextSearchTerm in initSelection

For single select the nextSearchTerm callback is called when
initSelection returned data
This commit is contained in:
Sebastian Kather 2014-01-16 16:12:00 +01:00
parent 7087c4bfbf
commit 48d392635f

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
this.dropdown.on("click mouseup mousedown", function (e) { e.stopPropagation(); });
this.nextSearchTerm = undefined;
if ($.isFunction(this.opts.initSelection)) {
// initialize selection based on the current value of the source element
this.initSelection();
@ -790,7 +792,6 @@ the specific language governing permissions and limitations under the Apache Lic
opts.element.prop("autofocus", false);
if (this.autofocus) this.focus();
this.nextSearchTerm = undefined;
},
// abstract
@ -2144,6 +2145,7 @@ the specific language governing permissions and limitations under the Apache Lic
self.updateSelection(selected);
self.close();
self.setPlaceholder();
self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val());
}
});
}