~ubuntu-branches/ubuntu/vivid/horizon/vivid

« back to all changes in this revision

Viewing changes to horizon/static/horizon/js/horizon.accordion_nav.js

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-03-30 11:12:29 UTC
  • mfrom: (0.14.1) (0.12.2) (76.1.7 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20150330111229-08du2zlqf9khi4k5
Tags: 1:2015.1~b3-0ubuntu1
* New upstream milestone release:
  - d/control: All version requirements with upstream, drop dependency
    on lockfile.
  - Refresh xstatic assets.
  - d/p/*: Refresh.
* d/pydist-overrides: Add overrides for oslo packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
horizon.addInitFunction(function() {
2
2
  var allPanelGroupBodies = $('.nav_accordion > dd > div > ul');
3
3
 
4
 
  allPanelGroupBodies.each(function(index, value) {
5
 
    var activePanels = $(this).find('li > a.active');
6
 
    if(activePanels.length === 0) {
7
 
      $(this).slideUp(0);
8
 
    }
9
 
  });
10
 
 
11
4
  // mark the active panel group
12
5
  var activePanel = $('.nav_accordion > dd > div > ul > li > a.active');
13
6
  activePanel.closest('div').find('h4').addClass('active');
38
31
      if (activeDashPanel.length === 0) {
39
32
        // expand the active panel group
40
33
        var activePanel = myDashBody.find("div:first > ul");
41
 
        activePanel.slideDown();
 
34
        activePanel.removeClass('hidden').slideDown();
42
35
        activePanel.closest('div').find("h4").addClass("active");
43
36
 
44
37
        // collapse the inactive panel groups
50
43
      {
51
44
        // collapse the inactive panel groups
52
45
        activeDashPanel.closest('div').find("h4").addClass("active");
53
 
        activeDashPanel.closest('ul').slideDown();
 
46
        activeDashPanel.closest('ul').removeClass('hidden').slideDown();
54
47
        allPanelGroupBodies.each(function(index, value) {
55
48
          var activePanels = $(value).find('li > a.active');
56
49
          if(activePanels.length === 0) {
75
68
    // expand the selected panel group if not already active
76
69
    if(!myPanelGroupWasActive) {
77
70
      myPanelGroupHeader.addClass("active");
78
 
      myPanelGroupHeader.closest('div').find('ul').slideDown();
 
71
      myPanelGroupHeader.closest('div').find('ul').removeClass('hidden')
 
72
        .slideDown();
79
73
    }
80
74
  });
81
75