1
0
mirror of synced 2024-11-23 05:26:10 +03:00

Relative paths for require

Now we can use relative paths in the calls to `require`, so those
using relative builds don't have to worry about modules not being
imported properly. This also makes it considerably easier in the
future when we look to cut down the build sizes and have a custom
builder, as we don't have to worry as much about the paths being
incorrect.

This fixes https://github.com/select2/select2/issues/3014 finally.
This commit is contained in:
Kevin Brown 2015-03-14 19:22:34 -04:00
parent d1e8a6fdad
commit 7e4e8bc9d6
5 changed files with 21 additions and 11 deletions

View File

@ -4200,6 +4200,7 @@ S2.define('select2/i18n/en',[],function () {
S2.define('select2/defaults',[ S2.define('select2/defaults',[
'jquery', 'jquery',
'require',
'./results', './results',
'./selection/single', './selection/single',
@ -4232,7 +4233,9 @@ S2.define('select2/defaults',[
'./dropdown/closeOnSelect', './dropdown/closeOnSelect',
'./i18n/en' './i18n/en'
], function ($, ResultsList, ], function ($, require,
ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear, SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch, EventRelay, SelectionSearch, EventRelay,
@ -4515,8 +4518,8 @@ S2.define('select2/defaults',[
} }
this.defaults = { this.defaults = {
amdBase: 'select2/', amdBase: './',
amdLanguageBase: 'select2/i18n/', amdLanguageBase: './i18n/',
closeOnSelect: true, closeOnSelect: true,
debug: false, debug: false,
escapeMarkup: Utils.escapeMarkup, escapeMarkup: Utils.escapeMarkup,

File diff suppressed because one or more lines are too long

9
dist/js/select2.js vendored
View File

@ -4200,6 +4200,7 @@ S2.define('select2/i18n/en',[],function () {
S2.define('select2/defaults',[ S2.define('select2/defaults',[
'jquery', 'jquery',
'require',
'./results', './results',
'./selection/single', './selection/single',
@ -4232,7 +4233,9 @@ S2.define('select2/defaults',[
'./dropdown/closeOnSelect', './dropdown/closeOnSelect',
'./i18n/en' './i18n/en'
], function ($, ResultsList, ], function ($, require,
ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear, SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch, EventRelay, SelectionSearch, EventRelay,
@ -4515,8 +4518,8 @@ S2.define('select2/defaults',[
} }
this.defaults = { this.defaults = {
amdBase: 'select2/', amdBase: './',
amdLanguageBase: 'select2/i18n/', amdLanguageBase: './i18n/',
closeOnSelect: true, closeOnSelect: true,
debug: false, debug: false,
escapeMarkup: Utils.escapeMarkup, escapeMarkup: Utils.escapeMarkup,

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,7 @@
define([ define([
'jquery', 'jquery',
'require',
'./results', './results',
'./selection/single', './selection/single',
@ -32,7 +34,9 @@ define([
'./dropdown/closeOnSelect', './dropdown/closeOnSelect',
'./i18n/en' './i18n/en'
], function ($, ResultsList, ], function ($, require,
ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear, SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch, EventRelay, SelectionSearch, EventRelay,
@ -315,8 +319,8 @@ define([
} }
this.defaults = { this.defaults = {
amdBase: 'select2/', amdBase: './',
amdLanguageBase: 'select2/i18n/', amdLanguageBase: './i18n/',
closeOnSelect: true, closeOnSelect: true,
debug: false, debug: false,
escapeMarkup: Utils.escapeMarkup, escapeMarkup: Utils.escapeMarkup,