Переглянути джерело

Remove deprecated jQuery shorthand (#5564)

kevin-j-morse 5 роки тому
батько
коміт
8a5aeabcce

+ 1 - 1
src/js/select2/data/tokenizer.js

@@ -58,7 +58,7 @@ define([
       // Replace the search term if we have the search box
       // Replace the search term if we have the search box
       if (this.$search.length) {
       if (this.$search.length) {
         this.$search.val(tokenData.term);
         this.$search.val(tokenData.term);
-        this.$search.focus();
+        this.$search.trigger('focus');
       }
       }
 
 
       params.term = tokenData.term;
       params.term = tokenData.term;

+ 4 - 4
src/js/select2/dropdown/search.js

@@ -49,10 +49,10 @@ define([
     container.on('open', function () {
     container.on('open', function () {
       self.$search.attr('tabindex', 0);
       self.$search.attr('tabindex', 0);
 
 
-      self.$search.focus();
+      self.$search.trigger('focus');
 
 
       window.setTimeout(function () {
       window.setTimeout(function () {
-        self.$search.focus();
+        self.$search.trigger('focus');
       }, 0);
       }, 0);
     });
     });
 
 
@@ -60,12 +60,12 @@ define([
       self.$search.attr('tabindex', -1);
       self.$search.attr('tabindex', -1);
 
 
       self.$search.val('');
       self.$search.val('');
-      self.$search.blur();
+      self.$search.trigger('blur');
     });
     });
 
 
     container.on('focus', function () {
     container.on('focus', function () {
       if (!container.isOpen()) {
       if (!container.isOpen()) {
-        self.$search.focus();
+        self.$search.trigger('focus');
       }
       }
     });
     });
 
 

+ 1 - 1
src/js/select2/selection/base.js

@@ -82,7 +82,7 @@ define([
       self.$selection.removeAttr('aria-owns');
       self.$selection.removeAttr('aria-owns');
 
 
       window.setTimeout(function () {
       window.setTimeout(function () {
-        self.$selection.focus();
+        self.$selection.trigger('focus');
       }, 0);
       }, 0);
     
     
       self._detachCloseHandler(container);
       self._detachCloseHandler(container);

+ 1 - 1
src/js/select2/selection/search.js

@@ -175,7 +175,7 @@ define([
 
 
     this.resizeSearch();
     this.resizeSearch();
     if (searchHadFocus) {
     if (searchHadFocus) {
-      this.$search.focus();
+      this.$search.trigger('focus');
     }
     }
   };
   };
 
 

+ 1 - 1
src/js/select2/selection/single.js

@@ -59,7 +59,7 @@ define([
 
 
     container.on('focus', function (evt) {
     container.on('focus', function (evt) {
       if (!container.isOpen()) {
       if (!container.isOpen()) {
-        self.$selection.focus();
+        self.$selection.trigger('focus');
       }
       }
     });
     });
   };
   };