MDL-38904 Theme/JavaScript: Tidy up bootstrap JS

This commit is contained in:
Andrew Nicols
2013-04-09 23:50:51 +01:00
parent 422f68fb86
commit 7e98ebd5ca
13 changed files with 2497 additions and 41 deletions
+5 -27
View File
@@ -1,27 +1,5 @@
YUI().use('gallery-bootstrap');
YUI.add('gallery-bootstrap', function(Y) {
var NS = Y.namespace('Bootstrap');
NS.initializer = function(e) {
NS.dropdown_delegation();
NS.expandable_delegation();
};
NS.expandable_delegation = function() {
Y.delegate('click', function(e) {
e.preventDefault();
var target = e.currentTarget;
if ( ! target.collapse ) {
target.plug( Y.Bootstrap.Collapse );
}
target.collapse.toggle();
}, document.body, '*[data-toggle="collapse"]' );
};
Y.on('domready', NS.initializer);
}, '@VERSION@' ,{requires:[ 'gallery-bootstrap-dropdown', 'gallery-bootstrap-collapse', 'gallery-bootstrap-engine']});
;
// We need to actually use the code manually here as this is tricky do in
// themes at present.
YUI().use('moodle-theme_bootstrap-bootstrap', function(Y) {
Y.Moodle.theme_bootstrap.bootstrap.init();
});