diff --git a/horizon/static/horizon/js/horizon.selenium.js b/horizon/static/horizon/js/horizon.selenium.js index 8649f40323..33151daaf6 100644 --- a/horizon/static/horizon/js/horizon.selenium.js +++ b/horizon/static/horizon/js/horizon.selenium.js @@ -35,14 +35,15 @@ horizon.addInitFunction(horizon.selenium.init = function() { }); horizon.selenium.initSideBarHelpers = function() { - var $activeEntry = $('li.openstack-dashboard.active > ul.panel-collapse.in'); - var dashboardLoc = 'li.openstack-dashboard'; - var groupLoc = 'li.nav-header.panel'; + var $activeEntry = $('.openstack-dashboard-active > ul.panel-collapse.in'); + var dashboardLoc = '.openstack-dashboard'; + var groupLoc = 'li.openstack-panel-group'; var activeCls = horizon.selenium.ACTIVE_CLS; var $activeDashboard = $activeEntry.closest(dashboardLoc).toggleClass(activeCls); var $activeGroup = $activeEntry.find( - 'li.nav-header.panel > ul.panel-collapse.in').closest(groupLoc).toggleClass(activeCls); + 'li.openstack-panel-group > ul.panel-collapse.in' + ).closest(groupLoc).toggleClass(activeCls); function toggleActiveDashboard($dashboard) { if ($activeDashboard) { diff --git a/horizon/static/horizon/js/horizon.sidebar.js b/horizon/static/horizon/js/horizon.sidebar.js new file mode 100644 index 0000000000..5cd27b2a76 --- /dev/null +++ b/horizon/static/horizon/js/horizon.sidebar.js @@ -0,0 +1,29 @@ +/* + * (c) Copyright 2015 Hewlett-Packard Development Company, L.P. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +$(document).ready(function () { + 'use strict'; + + var $sidenav = $('#sidebar'); + var $mask = $(document.createElement('div')) + .prop('id', 'sidebar-mask') + .appendTo($('#content_body')); + + // Hamburger Happiness !!! + $(document).on('click', '#sidebar-toggle', function () { + $mask.toggleClass('on-screen'); + $sidenav.toggleClass('on-screen'); + }); +}); diff --git a/horizon/templates/horizon/_sidebar.html b/horizon/templates/horizon/_sidebar.html index d6fb7dd3ff..f0c021c566 100644 --- a/horizon/templates/horizon/_sidebar.html +++ b/horizon/templates/horizon/_sidebar.html @@ -3,11 +3,11 @@