Permalink
Browse files

MDL-38904 Theme/JavaScript: Tidy up bootstrap JS

  • Loading branch information...
1 parent 422f68f commit 7e98ebd5ca7655e21794ce1527c33a9739820492 @andrewnicols andrewnicols committed Apr 9, 2013
@@ -152,11 +152,9 @@
);
$THEME->javascripts = array(
- 'bootstrapengine',
+);
+$THEME->javascripts_footer = array(
'moodlebootstrap',
- 'bootstrapcollapse',
- 'bootstrapdropdown',
- 'headercollapse',
);
$useragent = '';
@@ -1,10 +0,0 @@
-YUI().use('node', function(Y) {
- var toggleShow = function(e) {
- // Toggle the active class on both the clicked .btn-navbar and the .nav-collapse.
- // Our CSS will set the height for these
- var togglemenu = Y.one('.nav-collapse');
- togglemenu.toggleClass('active');
- this.toggleClass('active');
- };
- Y.delegate('click', toggleShow, Y.config.doc, '.btn-navbar');
-});
@@ -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.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 7e98ebd

Please sign in to comment.