Better handle AMD across files
Now that `define` and `require` are never made public, we have to build everything to support `$.fn.select2.amd` while also working with other AMD loaders.
This commit is contained in:
parent
8b77dcab98
commit
65875bf8e7
4
dist/js/select2.amd.full.js
vendored
4
dist/js/select2.amd.full.js
vendored
@ -1,4 +1,4 @@
|
|||||||
(function() {define('select2/utils',[], function () {
|
(function() { if ($ && $.fn && $.fn.select2 && $.fn.select2.amd) { define = $.fn.select2.amd.define; require = $.fn.select2.amd.require; }define('select2/utils',[], function () {
|
||||||
var Utils = {};
|
var Utils = {};
|
||||||
|
|
||||||
Utils.Extend = function (ChildClass, SuperClass) {
|
Utils.Extend = function (ChildClass, SuperClass) {
|
||||||
@ -1674,4 +1674,4 @@ define('jquery.select2',[
|
|||||||
return Select2;
|
return Select2;
|
||||||
});
|
});
|
||||||
|
|
||||||
require('jquery.select2'); $.Select2 = $.Select2 || {}; $.Select2.amd = { define: define };}());
|
require('jquery.select2'); $.fn.select2.amd = { define: define, require: require };}());
|
4
dist/js/select2.amd.js
vendored
4
dist/js/select2.amd.js
vendored
@ -1,4 +1,4 @@
|
|||||||
(function() {define('select2/utils',[], function () {
|
(function() { if ($ && $.fn && $.fn.select2 && $.fn.select2.amd) { define = $.fn.select2.amd.define; require = $.fn.select2.amd.require; }define('select2/utils',[], function () {
|
||||||
var Utils = {};
|
var Utils = {};
|
||||||
|
|
||||||
Utils.Extend = function (ChildClass, SuperClass) {
|
Utils.Extend = function (ChildClass, SuperClass) {
|
||||||
@ -1674,4 +1674,4 @@ define('jquery.select2',[
|
|||||||
return Select2;
|
return Select2;
|
||||||
});
|
});
|
||||||
|
|
||||||
require('jquery.select2'); $.Select2 = $.Select2 || {}; $.Select2.amd = { define: define };}());
|
require('jquery.select2'); $.fn.select2.amd = { define: define, require: require };}());
|
4
dist/js/select2.full.js
vendored
4
dist/js/select2.full.js
vendored
@ -1,4 +1,4 @@
|
|||||||
(function() {/**
|
(function() { if ($ && $.fn && $.fn.select2 && $.fn.select2.amd) { define = $.fn.select2.amd.define; require = $.fn.select2.amd.require; }/**
|
||||||
* @license almond 0.2.9 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
|
* @license almond 0.2.9 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
|
||||||
* Available via the MIT or new BSD license.
|
* Available via the MIT or new BSD license.
|
||||||
* see: http://github.com/jrburke/almond for details
|
* see: http://github.com/jrburke/almond for details
|
||||||
@ -11209,4 +11209,4 @@ define('jquery.select2',[
|
|||||||
return Select2;
|
return Select2;
|
||||||
});
|
});
|
||||||
|
|
||||||
require('jquery.select2'); $.Select2 = $.Select2 || {}; $.Select2.amd = { define: define };}());
|
require('jquery.select2'); $.fn.select2.amd = { define: define, require: require };}());
|
8
dist/js/select2.full.min.js
vendored
8
dist/js/select2.full.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/js/select2.js
vendored
4
dist/js/select2.js
vendored
@ -1,4 +1,4 @@
|
|||||||
(function() {/**
|
(function() { if ($ && $.fn && $.fn.select2 && $.fn.select2.amd) { define = $.fn.select2.amd.define; require = $.fn.select2.amd.require; }/**
|
||||||
* @license almond 0.2.9 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
|
* @license almond 0.2.9 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
|
||||||
* Available via the MIT or new BSD license.
|
* Available via the MIT or new BSD license.
|
||||||
* see: http://github.com/jrburke/almond for details
|
* see: http://github.com/jrburke/almond for details
|
||||||
@ -2102,4 +2102,4 @@ define('jquery.select2',[
|
|||||||
return Select2;
|
return Select2;
|
||||||
});
|
});
|
||||||
|
|
||||||
require('jquery.select2'); $.Select2 = $.Select2 || {}; $.Select2.amd = { define: define };}());
|
require('jquery.select2'); $.fn.select2.amd = { define: define, require: require };}());
|
2
dist/js/select2.min.js
vendored
2
dist/js/select2.min.js
vendored
File diff suppressed because one or more lines are too long
@ -372,7 +372,7 @@ $("[data-fill-from]").each(function () {
|
|||||||
|
|
||||||
prettyPrint();
|
prettyPrint();
|
||||||
|
|
||||||
require(["select2/core", "select2/utils"], function (Select2, Utils) {
|
$.fn.select2.amd.require(["select2/core", "select2/utils"], function (Select2, Utils) {
|
||||||
var $basicSingle = $(".js-example-basic-single");
|
var $basicSingle = $(".js-example-basic-single");
|
||||||
var $basicMultiple = $(".js-example-basic-multiple");
|
var $basicMultiple = $(".js-example-basic-multiple");
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"start": "(function() {",
|
"start": "(function() { if ($ && $.fn && $.fn.select2 && $.fn.select2.amd) { define = $.fn.select2.amd.define; require = $.fn.select2.amd.require; }",
|
||||||
"end": "require('jquery.select2'); $.Select2 = $.Select2 || {}; $.Select2.amd = { define: define, require: require };}());"
|
"end": "require('jquery.select2'); $.fn.select2.amd = { define: define, require: require };}());"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user