Bläddra i källkod

Fixed missing jQuery import

Now we are using `jQuery.noConflict()` in tests, so it should be
slightly easier to detect when this happens next time. Tests just
need to be written for the component.

This closes https://github.com/select2/select2/issues/2985.
Kevin Brown 10 år sedan
förälder
incheckning
01461813d8

+ 3 - 1
dist/js/select2.amd.full.js

@@ -1,4 +1,6 @@
-define(['jquery'], function ($) {define('select2/utils',[], function () {
+define(['jquery'], function ($) {define('select2/utils',[
+  'jquery'
+], function ($) {
   var Utils = {};
 
   Utils.Extend = function (ChildClass, SuperClass) {

+ 3 - 1
dist/js/select2.amd.js

@@ -1,4 +1,6 @@
-define(['jquery'], function ($) {define('select2/utils',[], function () {
+define(['jquery'], function ($) {define('select2/utils',[
+  'jquery'
+], function ($) {
   var Utils = {};
 
   Utils.Extend = function (ChildClass, SuperClass) {

+ 3 - 1
dist/js/select2.full.js

@@ -436,7 +436,9 @@ define('jquery',[],function () {
   return _$;
 });
 
-define('select2/utils',[], function () {
+define('select2/utils',[
+  'jquery'
+], function ($) {
   var Utils = {};
 
   Utils.Extend = function (ChildClass, SuperClass) {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/js/select2.full.min.js


+ 3 - 1
dist/js/select2.js

@@ -436,7 +436,9 @@ define('jquery',[],function () {
   return _$;
 });
 
-define('select2/utils',[], function () {
+define('select2/utils',[
+  'jquery'
+], function ($) {
   var Utils = {};
 
   Utils.Extend = function (ChildClass, SuperClass) {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/js/select2.min.js


+ 3 - 1
src/js/select2/utils.js

@@ -1,4 +1,6 @@
-define([], function () {
+define([
+  'jquery'
+], function ($) {
   var Utils = {};
 
   Utils.Extend = function (ChildClass, SuperClass) {

+ 2 - 0
tests/dropdown/selectOnClose-tests.js

@@ -1,5 +1,7 @@
 module('Dropdown - selectOnClose');
 
+var $ = require('jquery');
+
 var Utils = require('select2/utils');
 var Options = require('select2/options');
 

+ 4 - 0
tests/helpers.js

@@ -1,6 +1,10 @@
+// Restore the require/define
 var require = $.fn.select2.amd.require;
 var define = $.fn.select2.amd.define;
 
+// Disable jQuery's binding to $
+jQuery.noConflict();
+
 var Utils = require('select2/utils');
 
 function MockContainer () {

+ 2 - 0
tests/options/data-tests.js

@@ -1,5 +1,7 @@
 module('Options - Attributes');
 
+var $ = require('jquery');
+
 var Options = require('select2/options');
 
 test('no nesting', function (assert) {

+ 2 - 0
tests/options/width-tests.js

@@ -1,5 +1,7 @@
 module('Options - Width');
 
+var $ = require('jquery');
+
 var Select2 = require('select2/core');
 var select = new Select2($('<select></select>'));
 

Vissa filer visades inte eftersom för många filer har ändrats