From eca8612ed6e73256b8bb82a61be9ac9417ce7a8a Mon Sep 17 00:00:00 2001 From: benweet Date: Sun, 25 Aug 2013 01:56:12 +0200 Subject: [PATCH] Upgrade to Bootstrap 3 --- js/core.js | 8 ++++---- js/utils.js | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/js/core.js b/js/core.js index 90d722ab..a67cae36 100644 --- a/js/core.js +++ b/js/core.js @@ -459,8 +459,8 @@ define([ $menuPanelElt.on('show.bs.collapse', function(e) { if(e.target === $menuPanelElt[0]) { isMenuPanelShown = true; - //menuPanelBackdropElt = utils.createBackdrop('collapse', '.menu-panel'); - //$menuPanelElt.addClass('move-to-front'); + menuPanelBackdropElt = utils.createBackdrop('collapse', '.menu-panel'); + $menuPanelElt.addClass('move-to-front'); } else { // Close all open sub-menus when one submenu opens @@ -469,8 +469,8 @@ define([ }).on('hide.bs.collapse', function(e) { if(e.target === $menuPanelElt[0]) { isMenuPanelShown = false; - //menuPanelBackdropElt.remove(); - //$menuPanelElt.removeClass('move-to-front'); + menuPanelBackdropElt.remove(); + $menuPanelElt.removeClass('move-to-front'); } }).on('hidden.bs.collapse', function(e) { if(e.target === $menuPanelElt[0]) { diff --git a/js/utils.js b/js/utils.js index 9c29330e..f7debdd9 100644 --- a/js/utils.js +++ b/js/utils.js @@ -181,11 +181,14 @@ define([ // Create a backdrop and add to the body utils.createBackdrop = function(toggle, target) { var result = crel('div', { - 'class': 'modal-backdrop in', - 'data-toggle': toggle, - 'data-target': target, + 'class': 'modal-backdrop in' }); document.body.appendChild(result); + if(toggle == 'collapse') { + $(result).click(function() { + $(target).collapse('hide'); + }); + } return result; };