Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37932

Re: Probing if Editing is on

$
0
0
by Gareth J Barnard.  

Hi all,

A safe way to contain jQuery within YUI is via a synchronous loading module.  This is the code that mainly Andrew Nicols developed (and I a little) before MDL-15727 came along for the MyMobile theme:

YUI.applyConfig({
groups: {
'jquery': {
async: false,
combine: true,
modules: {
'jquery': {
fullpath: M.cfg.wwwroot + '/theme/mymobile/javascript/jquery-1.7.1.min.js'
},
'jquery-mymobile-custom': {
fullpath: M.cfg.wwwroot + '/theme/mymobile/javascript/custom.js',
requires: ['jquery']
},
'jquery-mymobile': {
fullpath: M.cfg.wwwroot + '/theme/mymobile/javascript/jquery.mobile-1.1.0.js',
requires: ['jquery-mymobile-custom']
}
}
}
}
});
YUI().use('jquery-mymobile', function(Y) {});

So you can then have jQuery in its own little cage and do any other bits and bobs within the empty braces of the 'use' function.

Cheers,

Gareth


Viewing all articles
Browse latest Browse all 37932

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>