1
votes

I have a problem with the AMD Loader. I want bind the bootstrap-slider.js and the css into the application. All the javascript and css are declare in a theme. Now the slider js don't harmonize with the dojo js. I found the explains from Marky Roden and the XSnippet von Ferry Kranenburg. In the custom control the code is very good. But I want all that in the theme for all the application. But it don't work. Can I disable, enable the AMD Loader in a theme?

1
Theoretically, with Ferry's snippet I'd say that it should work. Have you tried? - Mark Leusink
I cannot write this code<xp:this.contents><![CDATA[${javascript:"if (typeof define === 'function' && define.amd) {if(define.amd.vendor =='dojotoolkit.org'){define._amd = define.amd;delete define.amd;}}";}]]></xp:this.contents>code in a theme, or? - khsopro

1 Answers

7
votes

I think that's possible. Create 2 additional JavaScript files:

disable_amd.js with the following contents:

if (typeof define === 'function' && define.amd) {if(define.amd.vendor =='dojotoolkit.org'){define._amd = define.amd;delete define.amd;}}

and

enable_amd.js with the following contents:

if (typeof define === 'function' && define._amd) {define.amd = define._amd; delete define._amd;}

Load the first one before you load bootstrap-slider.js JavaScript file (place it above that) and the second one afterwards.