MDL-38904 Theme/JavaScript: Tidy up bootstrap JS
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user