From 64256f27f2e33ca92f20b1ab8c6fbe7bc5e8294f Mon Sep 17 00:00:00 2001 From: Joshua Jonah Date: Mon, 12 May 2014 21:44:27 -0400 Subject: [PATCH 01/11] Stopped refresh to top when `closeOnSelect: false` Not really sure how the noHighlightUpdate variable is supposed to work, it is undefined all the time so it appears to be broken. I just referred to `this.opts.closeOnSelect` to get the status directly. --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 580d32ed..5a1bc190 100644 --- a/select2.js +++ b/select2.js @@ -3107,7 +3107,7 @@ the specific language governing permissions and limitations under the Apache Lic } }); - if (this.highlight() == -1 && noHighlightUpdate !== false){ + if (this.highlight() == -1 && noHighlightUpdate !== false && this.opts.closeOnSelect === true){ self.highlight(0); } From 9d19b7f70192e0a69ec389ecd08edd45eb72bfe4 Mon Sep 17 00:00:00 2001 From: Fabrice Daugan Date: Mon, 4 Aug 2014 22:50:22 +0200 Subject: [PATCH 02/11] Redirect the focus of original input to Select2 Redirect the focus of original input to the "focus" event of Select2. this way, we get back the accessible label for feature of previous Select2 versions. --- select2.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/select2.js b/select2.js index fa4d21a7..0aecaefb 100644 --- a/select2.js +++ b/select2.js @@ -2096,6 +2096,7 @@ the specific language governing permissions and limitations under the Apache Lic this.focusser.attr("id", "s2id_autogen"+idSuffix); elementLabel = $("label[for='" + this.opts.element.attr("id") + "']"); + this.opts.element.focus(this.bind(function () { this.focus(); })); this.focusser.prev() .text(elementLabel.text()) @@ -2686,6 +2687,7 @@ the specific language governing permissions and limitations under the Apache Lic this.search.prev() .text($("label[for='" + this.opts.element.attr("id") + "']").text()) .attr('for', this.search.attr('id')); + this.opts.element.focus(this.bind(function () { this.focus(); })); this.search.on("input paste", this.bind(function() { if (this.search.attr('placeholder') && this.search.val().length == 0) return; From fd9006047c9b46982df0604a6f6e57437fb348f3 Mon Sep 17 00:00:00 2001 From: Michael Prentice Date: Wed, 29 Oct 2014 12:41:03 -0400 Subject: [PATCH 03/11] Updated link for AngularUI They have deprecated the original ui-select2 directive in favor of the new and better supported ui-select directive. This happened a couple weeks ago. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0acf240b..264ba730 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Integrations * [Wicket-Select2](https://github.com/ivaynberg/wicket-select2) (Java / [Apache Wicket](http://wicket.apache.org)) * [select2-rails](https://github.com/argerim/select2-rails) (Ruby on Rails) -* [AngularUI](http://angular-ui.github.com/#directives-select2) ([AngularJS](http://angularjs.org)) +* [AngularUI](http://angular-ui.github.io/#ui-select) ([AngularJS](http://angularjs.org)) * [Django](https://github.com/applegrew/django-select2) * [Symfony](https://github.com/19Gerhard85/sfSelect2WidgetsPlugin) * [Symfony2](https://github.com/avocode/FormExtensions) From 9ff939b534789bbf2dda0aa268a01ac63629e614 Mon Sep 17 00:00:00 2001 From: Michael Prentice Date: Wed, 29 Oct 2014 12:45:07 -0400 Subject: [PATCH 04/11] Updated AngularJS link to HTTPS HTTPS everywhere --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 264ba730..64380c45 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Integrations * [Wicket-Select2](https://github.com/ivaynberg/wicket-select2) (Java / [Apache Wicket](http://wicket.apache.org)) * [select2-rails](https://github.com/argerim/select2-rails) (Ruby on Rails) -* [AngularUI](http://angular-ui.github.io/#ui-select) ([AngularJS](http://angularjs.org)) +* [AngularUI](http://angular-ui.github.io/#ui-select) ([AngularJS](https://angularjs.org/)) * [Django](https://github.com/applegrew/django-select2) * [Symfony](https://github.com/19Gerhard85/sfSelect2WidgetsPlugin) * [Symfony2](https://github.com/avocode/FormExtensions) From 3a9896dc4bfc9cb14892edfcfe09bf7bb1bae281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Johansen?= Date: Wed, 29 Oct 2014 22:13:48 +0100 Subject: [PATCH 05/11] =?UTF-8?q?Replaced=20nonexistent=20locale=20"no"=20?= =?UTF-8?q?with=20"nb"=20(Norwegian=20Bokm=C3=A5l).=20Added=20space=20befo?= =?UTF-8?q?re=20ellipsis=20for=20correct=20punctuation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- select2_locale_no.js => select2_locale_nb.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) rename select2_locale_no.js => select2_locale_nb.js (76%) diff --git a/select2_locale_no.js b/select2_locale_nb.js similarity index 76% rename from select2_locale_no.js rename to select2_locale_nb.js index e00408cf..89004485 100644 --- a/select2_locale_no.js +++ b/select2_locale_nb.js @@ -1,18 +1,19 @@ /** - * Select2 Norwegian translation. + * Select2 Norwegian Bokmål translation. * * Author: Torgeir Veimo + * Author: Bjørn Johansen */ (function ($) { "use strict"; - $.fn.select2.locales['no'] = { + $.fn.select2.locales['nb'] = { formatNoMatches: function () { return "Ingen treff"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Vennligst skriv inn " + n + (n>1 ? " flere tegn" : " tegn til"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Vennligst fjern " + n + " tegn"; }, formatSelectionTooBig: function (limit) { return "Du kan velge maks " + limit + " elementer"; }, - formatLoadMore: function (pageNumber) { return "Laster flere resultater…"; }, - formatSearching: function () { return "Søker…"; } + formatLoadMore: function (pageNumber) { return "Laster flere resultater …"; }, + formatSearching: function () { return "Søker …"; } }; $.extend($.fn.select2.defaults, $.fn.select2.locales['no']); From d1c19eb012a6688ff54c48283d3a5463429efe4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Johansen?= Date: Wed, 29 Oct 2014 22:36:54 +0100 Subject: [PATCH 06/11] Added the formatMatches string --- select2_locale_nb.js | 1 + 1 file changed, 1 insertion(+) diff --git a/select2_locale_nb.js b/select2_locale_nb.js index 89004485..cb5dfaee 100644 --- a/select2_locale_nb.js +++ b/select2_locale_nb.js @@ -8,6 +8,7 @@ "use strict"; $.fn.select2.locales['nb'] = { + formatMatches: function (matches) { if (matches === 1) { return "Ett resultat er tilgjengelig, trykk enter for å velge det."; } return matches + " resultater er tilgjengelig. Bruk piltastene opp og ned for å navigere."; }, formatNoMatches: function () { return "Ingen treff"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Vennligst skriv inn " + n + (n>1 ? " flere tegn" : " tegn til"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Vennligst fjern " + n + " tegn"; }, From 0daee346264e8325575b69bf2da5aa2c42158b98 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Fri, 31 Oct 2014 18:10:13 -0400 Subject: [PATCH 07/11] Fixed Select2 jumping around in Chrome This fixes #2769, where Select2 will jump around because of how focus moves to the original element when selections are made. Because absolute positioning pushed the original element out of the viewport, bringing it back into the viewport should be the best fix. --- select2.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.css b/select2.css index f39cb21d..9b7a979d 100644 --- a/select2.css +++ b/select2.css @@ -667,7 +667,7 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { margin: 0 !important; padding: 0 !important; overflow: hidden !important; - position: absolute !important; + position: static !important; outline: 0 !important; left: 0px !important; top: 0px !important; From 1de4be3749528e71c53438673092f59abbbf1f71 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Fri, 31 Oct 2014 18:15:32 -0400 Subject: [PATCH 08/11] Fixed TypeError when destroying Select2 This fixes #2587. --- select2.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/select2.js b/select2.js index 5fc599aa..5591ea9d 100644 --- a/select2.js +++ b/select2.js @@ -2214,11 +2214,17 @@ the specific language governing permissions and limitations under the Apache Lic })); selection.on("mousedown touchstart", "abbr", this.bind(function (e) { - if (!this.isInterfaceEnabled()) return; + if (!this.isInterfaceEnabled()) { + return; + } + this.clear(); killEventImmediately(e); this.close(); - this.selection.focus(); + + if (this.selection) { + this.selection.focus(); + } })); selection.on("mousedown touchstart", this.bind(function (e) { From e943f6ef08cd5ab5f6104efc5288daeab9f33162 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Fri, 31 Oct 2014 18:27:33 -0400 Subject: [PATCH 09/11] Revert "Fixed Select2 jumping around in Chrome" This reverts commit 0daee346264e8325575b69bf2da5aa2c42158b98. This results in artifacts being displayed in Chrome, and doesn't fix the other jumping issue. --- select2.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.css b/select2.css index 9b7a979d..f39cb21d 100644 --- a/select2.css +++ b/select2.css @@ -667,7 +667,7 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { margin: 0 !important; padding: 0 !important; overflow: hidden !important; - position: static !important; + position: absolute !important; outline: 0 !important; left: 0px !important; top: 0px !important; From db7cd1b373f9a2a743a68ce32cc59dc8fc899eb8 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Sat, 1 Nov 2014 14:28:22 -0400 Subject: [PATCH 10/11] Go back to hiding the original element This was only done to maintain compatibility with labels, back when we could capture the focus events from the original element. Now that we handle them in a different way, this is no longer needed. This fixes #2769. --- select2.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/select2.js b/select2.js index 5591ea9d..b66a2d49 100644 --- a/select2.js +++ b/select2.js @@ -871,7 +871,7 @@ the specific language governing permissions and limitations under the Apache Lic select2.liveRegion.remove(); select2.dropdown.remove(); element - .removeClass("select2-offscreen") + .show() .removeData("select2") .off(".select2") .prop("autofocus", this.autofocus || false); @@ -2273,7 +2273,7 @@ the specific language governing permissions and limitations under the Apache Lic })); this.initContainerWidth(); - this.opts.element.addClass("select2-offscreen"); + this.opts.element.hide(); this.setPlaceholder(); }, @@ -2856,7 +2856,7 @@ the specific language governing permissions and limitations under the Apache Lic })); this.initContainerWidth(); - this.opts.element.addClass("select2-offscreen"); + this.opts.element.hide(); // set the placeholder if necessary this.clearSearch(); From 4e19d879276a2639e76af07f56832a8646283d87 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Sat, 1 Nov 2014 14:43:38 -0400 Subject: [PATCH 11/11] modified version identifiers in descriptors for release 3.5.2 --- bower.json | 2 +- component.json | 2 +- composer.json | 2 +- package.json | 2 +- select2.jquery.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bower.json b/bower.json index d659504d..54d44c45 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "select2", - "version": "3.5.1", + "version": "3.5.2", "main": ["select2.js", "select2.css", "select2.png", "select2x2.png", "select2-spinner.gif"], "dependencies": { "jquery": ">= 1.7.1" diff --git a/component.json b/component.json index 65e4e455..8bd3c020 100644 --- a/component.json +++ b/component.json @@ -2,7 +2,7 @@ "name": "select2", "repo": "ivaynberg/select2", "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.", - "version": "3.5.1", + "version": "3.5.2", "demo": "http://ivaynberg.github.io/select2/", "keywords": [ "jquery" diff --git a/composer.json b/composer.json index a0a4602b..cd2d26a2 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "ivaynberg/select2", "description": "Select2 is a jQuery based replacement for select boxes.", - "version": "3.5.1", + "version": "3.5.2", "type": "component", "homepage": "http://ivaynberg.github.io/select2/", "license": "Apache-2.0", diff --git a/package.json b/package.json index 23ba85ba..709cb1c6 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "author": "Igor Vaynberg", "repository": {"type": "git", "url": "git://github.com/ivaynberg/select2.git"}, "main": "select2.js", - "version": "3.5.1", + "version": "3.5.2", "jspm": { "main": "select2", "files": ["select2.js", "select2.png", "select2.css", "select2-spinner.gif"], diff --git a/select2.jquery.json b/select2.jquery.json index 469c4aa7..b005d8a2 100644 --- a/select2.jquery.json +++ b/select2.jquery.json @@ -11,7 +11,7 @@ "tag", "tagging" ], - "version": "3.5.1", + "version": "3.5.2", "author": { "name": "Igor Vaynberg", "url": "https://github.com/ivaynberg"