AMD Loader disable, enable in theme

后端 未结 1 1774
遥遥无期
遥遥无期 2021-01-25 04:41

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

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-25 05:15

    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.

    0 讨论(0)
提交回复
热议问题