|
1 | | -/* |
| 1 | +/* |
2 | 2 | Copyright 2012 Igor Vaynberg |
3 | 3 |
|
4 | 4 | Version: @@ver@@ Timestamp: @@timestamp@@ |
|
521 | 521 | search.bind("focus", function () { search.addClass("select2-focused"); if (search.val() === " ") search.val(""); }); |
522 | 522 | search.bind("blur", function () { search.removeClass("select2-focused");}); |
523 | 523 |
|
524 | | - this.dropdown.delegate(resultsSelector, "click", this.bind(function (e) { |
| 524 | + this.dropdown.delegate(resultsSelector, "mouseup", this.bind(function (e) { |
525 | 525 | if ($(e.target).closest(".select2-result-selectable:not(.select2-disabled)").length > 0) { |
526 | 526 | this.highlightUnderEvent(e); |
527 | 527 | this.selectHighlighted(e); |
|
1305 | 1305 | window.setTimeout(this.bind(function() { this.selection.attr("tabIndex", this.opts.element.attr("tabIndex")); }), 10); |
1306 | 1306 | })); |
1307 | 1307 |
|
1308 | | - selection.bind("click", this.bind(function (e) { |
| 1308 | + selection.bind("mousedown", this.bind(function (e) { |
1309 | 1309 | clickingInside = true; |
1310 | 1310 |
|
1311 | 1311 | if (this.opened()) { |
|
1319 | 1319 | clickingInside = false; |
1320 | 1320 | })); |
1321 | 1321 |
|
1322 | | - dropdown.bind("click", this.bind(function() { this.search.focus(); })); |
| 1322 | + dropdown.bind("mousedown", this.bind(function() { this.search.focus(); })); |
1323 | 1323 |
|
1324 | 1324 | selection.bind("focus", this.bind(function() { |
1325 | 1325 | this.container.addClass("select2-container-active"); |
|
1372 | 1372 | killEvent(e); |
1373 | 1373 | })); |
1374 | 1374 |
|
1375 | | - selection.delegate("abbr", "click", this.bind(function (e) { |
| 1375 | + selection.delegate("abbr", "mousedown", this.bind(function (e) { |
1376 | 1376 | if (!this.enabled) return; |
1377 | 1377 | this.clear(); |
1378 | 1378 | killEvent(e); |
|
1685 | 1685 | this.container.removeClass("select2-container-active"); |
1686 | 1686 | })); |
1687 | 1687 |
|
1688 | | - this.container.delegate(selector, "click", this.bind(function (e) { |
| 1688 | + this.container.delegate(selector, "mousedown", this.bind(function (e) { |
1689 | 1689 | if (!this.enabled) return; |
1690 | 1690 | this.clearPlaceholder(); |
1691 | 1691 | this.open(); |
|
0 commit comments