Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MDL-38904 Theme/JavaScript: Tidy up bootstrap JS
  • Loading branch information
andrewnicols committed Apr 9, 2013
1 parent 422f68f commit 7e98ebd
Show file tree
Hide file tree
Showing 13 changed files with 2,497 additions and 41 deletions.
6 changes: 2 additions & 4 deletions theme/bootstrap/config.php
Expand Up @@ -152,11 +152,9 @@
);

$THEME->javascripts = array(
'bootstrapengine',
);
$THEME->javascripts_footer = array(
'moodlebootstrap',
'bootstrapcollapse',
'bootstrapdropdown',
'headercollapse',
);

$useragent = '';
Expand Down
10 changes: 0 additions & 10 deletions theme/bootstrap/javascript/headercollapse.js

This file was deleted.

32 changes: 5 additions & 27 deletions theme/bootstrap/javascript/moodlebootstrap.js
@@ -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();
});

Large diffs are not rendered by default.

0 comments on commit 7e98ebd

Please sign in to comment.