From 908c3583d7b4bbb388b424f86354c362bdfcf695 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Thu, 13 Sep 2012 14:42:53 -0700 Subject: [PATCH] bind abbr handler before mousedown. fixes #386 --- select2.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/select2.js b/select2.js index c9c97526..6c9be910 100644 --- a/select2.js +++ b/select2.js @@ -1497,6 +1497,15 @@ window.setTimeout(this.bind(function() { this.selection.attr("tabIndex", this.opts.element.attr("tabIndex")); }), 10); })); + selection.delegate("abbr", "mousedown", this.bind(function (e) { + if (!this.enabled) return; + this.clear(); + killEventImmediately(e); + this.close(); + this.triggerChange(); + this.selection.focus(); + })); + selection.bind("mousedown", this.bind(function (e) { clickingInside = true; @@ -1580,15 +1589,6 @@ killEvent(e); })); - selection.delegate("abbr", "mousedown", this.bind(function (e) { - if (!this.enabled) return; - this.clear(); - killEventImmediately(e); - this.close(); - this.triggerChange(); - this.selection.focus(); - })); - this.setPlaceholder(); this.search.bind("focus", this.bind(function() {