|
@@ -11,27 +11,11 @@ define([
|
|
AttachBody.prototype.bind = function (decorated, container, $container) {
|
|
AttachBody.prototype.bind = function (decorated, container, $container) {
|
|
var self = this;
|
|
var self = this;
|
|
|
|
|
|
- var setupResultsEvents = false;
|
|
|
|
-
|
|
|
|
decorated.call(this, container, $container);
|
|
decorated.call(this, container, $container);
|
|
|
|
|
|
container.on('open', function () {
|
|
container.on('open', function () {
|
|
self._showDropdown();
|
|
self._showDropdown();
|
|
self._attachPositioningHandler(container);
|
|
self._attachPositioningHandler(container);
|
|
-
|
|
|
|
- if (!setupResultsEvents) {
|
|
|
|
- setupResultsEvents = true;
|
|
|
|
-
|
|
|
|
- container.on('results:all', function () {
|
|
|
|
- self._positionDropdown();
|
|
|
|
- self._resizeDropdown();
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- container.on('results:append', function () {
|
|
|
|
- self._positionDropdown();
|
|
|
|
- self._resizeDropdown();
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
});
|
|
});
|
|
|
|
|
|
container.on('close', function () {
|
|
container.on('close', function () {
|
|
@@ -39,6 +23,26 @@ define([
|
|
self._detachPositioningHandler(container);
|
|
self._detachPositioningHandler(container);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ container.on('results:all', function () {
|
|
|
|
+ self._positionDropdown();
|
|
|
|
+ self._resizeDropdown();
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ container.on('results:append', function () {
|
|
|
|
+ self._positionDropdown();
|
|
|
|
+ self._resizeDropdown();
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ container.on('select', function () {
|
|
|
|
+ self._positionDropdown();
|
|
|
|
+ self._resizeDropdown();
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ container.on('unselect', function () {
|
|
|
|
+ self._positionDropdown();
|
|
|
|
+ self._resizeDropdown();
|
|
|
|
+ });
|
|
|
|
+
|
|
this.$dropdownContainer.on('mousedown', function (evt) {
|
|
this.$dropdownContainer.on('mousedown', function (evt) {
|
|
evt.stopPropagation();
|
|
evt.stopPropagation();
|
|
});
|
|
});
|