patternfly-sass 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d6304c067481013f946c6396e99076af23ddaa74
4
- data.tar.gz: a6a17ea1b028bf92483cc9b37bdc355adb2bf803
3
+ metadata.gz: 4c34f20b8ab4b9005ab5b6e3b01938d41d8a16b2
4
+ data.tar.gz: 46441e1fd8d66a2bbd8e0a85603fc9ea1bebb0f2
5
5
  SHA512:
6
- metadata.gz: 6c1b5b6f88c644c6fecb826490ce428d1bda9cf3cb7b522168c8bb627e6f5bd216a94ba01b9864a8a3925aa4b7f6aa337b47369c2d7f10de9f580d86eab343f5
7
- data.tar.gz: c178211cd8acd0d4e8831834878f417e7473e7fa1de7000cb88cd1266e22398ab6fe39973f26b3798b75857a3ff1b7f15847ae2021067bfd9f4a14abb1e22878
6
+ metadata.gz: 9f67615266da22bb7e3e897ea7b3b0bd253d4df3c52b88b6260060edbd9d58870825783bb4dfa3eeb026916e5f86b5d95d6836b56021977a7e45a9440c32bbd2
7
+ data.tar.gz: 80c0bf70991b0db46f7b96aca022f7dd91f88dbbddc0d3e9e2213d6870d6f45f5cf8ece3ce7527a2119aa5acd9fa0d053464ce7207d439348ebc7fc0f96ea9d9
@@ -187,8 +187,8 @@
187
187
  i;
188
188
 
189
189
  for (i = 0; i < ien; i += 1) {
190
- $('.paginate_input').val(iCurrentPage);
191
- $('.paginate_of b').html(iPages);
190
+ $('.paginate_input', an[i]).val(iCurrentPage)
191
+ .siblings('.paginate_of').find('b').html(iPages);
192
192
 
193
193
  // Add / remove disabled classes from the static elements
194
194
  if (oPaging.iPage === 0) {
@@ -393,140 +393,491 @@
393
393
  };
394
394
  }(jQuery));
395
395
 
396
+ // Util: PatternFly Palette colors
397
+ (function ($) {
398
+ 'use strict';
399
+
400
+ $.pfPaletteColors = {
401
+ black: '#030303',
402
+ black100: '#fafafa',
403
+ black200: '#ededed',
404
+ black300: '#d1d1d1',
405
+ black400: '#bbbbbb',
406
+ black500: '#8b8d8f',
407
+ black600: '#72767b',
408
+ black700: '#4d5258',
409
+ black800: '#393f44',
410
+ black900: '#292e34',
411
+ blue: '#0088ce',
412
+ blue100: '#bee1f4',
413
+ blue200: '#7dc3e8',
414
+ blue300: '#39a5dc',
415
+ blue400: '#0088ce',
416
+ blue500: '#00659c',
417
+ blue600: '#004368',
418
+ blue700: '#002235',
419
+ gold: '#f0ab00',
420
+ gold100: '#fbeabc',
421
+ gold200: '#f9d67a',
422
+ gold300: '#f5c12e',
423
+ gold400: '#f0ab00',
424
+ gold500: '#b58100',
425
+ gold600: '#795600',
426
+ gold700: '#3d2c00',
427
+ orange: '#ec7a08',
428
+ orange100: '#fbdebf',
429
+ orange200: '#f7bd7f',
430
+ orange300: '#f39d3c',
431
+ orange400: '#ec7a08',
432
+ orange500: '#b35c00',
433
+ orange600: '#773d00',
434
+ orange700: '#3b1f00',
435
+ lightBlue: '#00b9e4',
436
+ lightBlue100: '#beedf9',
437
+ lightBlue200: '#7cdbf3',
438
+ lightBlue300: '#35caed',
439
+ lightBlue400: '#00b9e4',
440
+ lightBlue500: '#008bad',
441
+ lightBlue600: '#005c73',
442
+ lightBlue700: '#002d39',
443
+ green: '#3f9c35',
444
+ green100: '#cfe7cd',
445
+ green200: '#9ecf99',
446
+ green300: '#6ec664',
447
+ green400: '#3f9c35',
448
+ green500: '#2d7623',
449
+ green600: '#1e4f18',
450
+ green700: '#0f280d',
451
+ lightGreen: '#92d400',
452
+ lightGreen100: '#e4f5bc',
453
+ lightGreen200: '#c8eb79',
454
+ lightGreen300: '#ace12e',
455
+ lightGreen400: '#92d400',
456
+ lightGreen500: '#6ca100',
457
+ lightGreen600: '#486b00',
458
+ lightGreen700: '#253600',
459
+ cyan: '#007a87',
460
+ cyan100: '#bedee1',
461
+ cyan200: '#7dbdc3',
462
+ cyan300: '#3a9ca6',
463
+ cyan400: '#007a87',
464
+ cyan500: '#005c66',
465
+ cyan600: '#003d44',
466
+ cyan700: '#001f22',
467
+ purple: '#703fec',
468
+ purple100: '#c7bfff',
469
+ purple200: '#a18fff',
470
+ purple300: '#8461f7',
471
+ purple400: '#703fec',
472
+ purple500: '#582fc0',
473
+ purple600: '#40199a',
474
+ purple700: '#1f0066',
475
+ red: '#cc0000',
476
+ red100: '#cc0000',
477
+ red200: '#a30000',
478
+ red300: '#8b0000',
479
+ red400: '#470000',
480
+ red500: '#2c0000'
481
+ };
482
+ }(jQuery));
483
+
396
484
  // Util: PatternFly C3 Chart Defaults
397
485
  (function ($) {
398
486
  'use strict';
399
487
 
400
- $.fn.c3ChartDefaults = function () {
401
- var getDefaultColors,
402
- getDefaultDonut,
403
- getDefaultDonutSize,
404
- getDefaultDonutColors,
405
- getDefaultDonutTooltip,
406
- getDefaultDonutLegend,
407
- getDefaultDonutConfig,
408
- getDefaultSparklineArea,
409
- getDefaultSparklineSize,
410
- getDefaultSparklineAxis,
411
- getDefaultSparklineLegend,
412
- getDefaultSparklinePoint,
413
- getDefaultSparklineTooltip,
414
- getDefaultSparklineConfig;
415
-
416
- getDefaultColors = function () {
417
- return {
418
- pattern: ['#0088ce', '#00659c', '#3f9c35', '#ec7a08', '#cc0000']
419
- };
420
- };
421
- getDefaultDonut = function (title) {
422
- return {
423
- title: title,
424
- label: {
425
- show: false
426
- },
427
- width: 11
428
- };
429
- };
430
- getDefaultDonutSize = function () {
431
- return {
432
- height: 171 // produces a diameter of 150 and a centered chart
433
- };
434
- };
435
- getDefaultDonutColors = function () {
436
- return {
437
- pattern: ['#0088CE', '#D1D1D1']
438
- };
439
- };
440
- getDefaultDonutTooltip = function () {
441
- return {
442
- show: false
443
- };
444
- };
445
- getDefaultDonutLegend = function () {
446
- return {
447
- show: false
448
- };
449
- };
450
- getDefaultDonutConfig = function (title) {
451
- return {
452
- donut: this.getDefaultDonut(title),
453
- size: this.getDefaultDonutSize(),
454
- legend: this.getDefaultDonutLegend(),
455
- color: this.getDefaultDonutColors(),
456
- tooltip: this.getDefaultDonutTooltip()
457
- };
488
+ $.fn.pfSetDonutChartTitle = function (selector, primary, secondary) {
489
+ var donutChartRightTitle = window.d3.select(selector).select('text.c3-chart-arcs-title');
490
+ donutChartRightTitle.text("");
491
+ donutChartRightTitle.insert('tspan').text(primary).classed('donut-title-big-pf', true).attr('dy', 0).attr('x', 0);
492
+ donutChartRightTitle.insert('tspan').text(secondary).classed('donut-title-small-pf', true).attr('dy', 20).attr('x', 0);
493
+ };
494
+
495
+ $.fn.pfDonutTooltipContents = function (d, defaultTitleFormat, defaultValueFormat, color) {
496
+ return '<table class="c3-tooltip">' +
497
+ ' <tr>' +
498
+ ' <td><span style="background-color:' + color(d[0].id) + '"></span>' + '<strong>' + d[0].value + '</strong> ' + d[0].name + '</td>' +
499
+ ' <td>' + (Math.round(d[0].ratio * 1000) / 10) + '%</td>' +
500
+ ' </tr>' +
501
+ '</table>';
502
+ };
503
+
504
+ $.fn.pGetUtilizationDonutTooltipContentsFn = function (units) {
505
+ return function (d) {
506
+ return '<span class="donut-tooltip-pf" style="white-space: nowrap;">' +
507
+ (Math.round(d[0].ratio * 1000) / 10) + '%' + ' ' + units + ' ' + d[0].name +
508
+ '</span>';
458
509
  };
459
- getDefaultSparklineArea = function () {
460
- return {
461
- zerobased: true
462
- };
510
+ };
511
+
512
+ $.fn.pfGetBarChartTooltipContentsFn = function (categories) {
513
+ return function (d) {
514
+ var name = categories ? categories[d[0].index] : d[0].index;
515
+ return '<table class="c3-tooltip">' +
516
+ ' <tr>' +
517
+ ' <td><strong>' + name + ':</td>' +
518
+ ' <td>' + d[0].value + '</td>' +
519
+ ' </tr>' +
520
+ '</table>';
463
521
  };
464
- getDefaultSparklineSize = function () {
465
- return {
466
- height: 60
467
- };
522
+ };
523
+
524
+ $.fn.pfSingleLineChartTooltipContentsFn = function (categories) {
525
+ return function (d) {
526
+ var name = categories ? categories[d[0].index] : d[0].index;
527
+ return '<table class="c3-tooltip">' +
528
+ ' <tr>' +
529
+ ' <td><strong>' + name + ':</td>' +
530
+ ' <td>' + d[0].value + '</td>' +
531
+ ' </tr>' +
532
+ '</table>';
468
533
  };
469
- getDefaultSparklineAxis = function () {
470
- return {
471
- x: {
534
+ };
535
+
536
+ $.fn.pfPieTooltipContents = function (d, defaultTitleFormat, defaultValueFormat, color) {
537
+ return $().pfDonutTooltipContents(d, defaultTitleFormat, defaultValueFormat, color);
538
+ };
539
+
540
+ $.fn.c3ChartDefaults = function () {
541
+ var
542
+ getDefaultColors = function () {
543
+ return {
544
+ pattern: [
545
+ $.pfPaletteColors.blue,
546
+ $.pfPaletteColors.blue300,
547
+ $.pfPaletteColors.green,
548
+ $.pfPaletteColors.orange,
549
+ $.pfPaletteColors.red
550
+ ]
551
+ };
552
+ },
553
+ getDefaultBarGrid = function () {
554
+ return {
555
+ y: {
556
+ show: true
557
+ }
558
+ };
559
+ },
560
+ getDefaultBarTooltip = function (categories) {
561
+ return {
562
+ contents: $().pfGetBarChartTooltipContentsFn(categories)
563
+ };
564
+ },
565
+ getDefaultBarLegend = function () {
566
+ return {
472
567
  show: false
473
- },
474
- y: {
568
+ };
569
+ },
570
+ getDefaultBarConfig = function (categories) {
571
+ return {
572
+ color: this.getDefaultColors(),
573
+ grid: this.getDefaultBarGrid(),
574
+ tooltip: this.getDefaultBarTooltip(categories),
575
+ legend: this.getDefaultBarLegend()
576
+ };
577
+ },
578
+ getDefaultGroupedBarGrid = function () {
579
+ return {
580
+ y: {
581
+ show: true
582
+ }
583
+ };
584
+ },
585
+ getDefaultGroupedBarLegend = function () {
586
+ return {
587
+ show: true,
588
+ position: 'bottom'
589
+ };
590
+ },
591
+ getDefaultGroupedBarConfig = function () {
592
+ return {
593
+ color: this.getDefaultColors(),
594
+ grid: this.getDefaultGroupedBarGrid(),
595
+ legend: this.getDefaultGroupedBarLegend()
596
+ };
597
+ },
598
+ getDefaultDonut = function (title) {
599
+ return {
600
+ title: title,
601
+ label: {
602
+ show: false
603
+ },
604
+ width: 11
605
+ };
606
+ },
607
+ getDefaultDonutSize = function () {
608
+ return {
609
+ height: 171, // produces a diameter of 150 and a centered chart when there is no legend
610
+ width: 171 // produces a diameter of 150 and a centered chart
611
+ };
612
+ },
613
+ getDefaultDonutColors = function () {
614
+ return {
615
+ pattern: [
616
+ $.pfPaletteColors.blue,
617
+ $.pfPaletteColors.black300
618
+ ]
619
+ };
620
+ },
621
+ getDefaultDonutTooltip = function () {
622
+ return {
475
623
  show: false
476
- }
477
- };
478
- };
479
- getDefaultSparklineLegend = function () {
480
- return {
481
- show: false
482
- };
483
- };
484
- getDefaultSparklinePoint = function () {
485
- return {
486
- r: 1,
487
- focus: {
488
- expand: {
489
- r: 4
624
+ };
625
+ },
626
+ getDefaultDonutLegend = function () {
627
+ return {
628
+ show: false
629
+ };
630
+ },
631
+ getDefaultDonutConfig = function (title) {
632
+ return {
633
+ donut: this.getDefaultDonut(title),
634
+ size: this.getDefaultDonutSize(),
635
+ legend: this.getDefaultDonutLegend(),
636
+ color: this.getDefaultDonutColors(),
637
+ tooltip: this.getDefaultDonutTooltip()
638
+ };
639
+ },
640
+ getDefaultPie = function () {
641
+ return {
642
+ expand: true,
643
+ label: {
644
+ show: false
490
645
  }
491
- }
492
- };
493
- };
494
- getDefaultSparklineTooltip = function () {
495
- return {
496
- // because a sparkline should only contain a single data column,
497
- // the tooltip will only work for a single data column
498
- contents: function (d) {
499
- return '<span class="c3-tooltip-sparkline">' + d[0].value + ' ' + d[0].name + '</span>';
500
- }
501
- };
502
- };
503
- getDefaultSparklineConfig = function () {
504
- return {
505
- area: getDefaultSparklineArea(),
506
- size: getDefaultSparklineSize(),
507
- axis: getDefaultSparklineAxis(),
508
- color: getDefaultColors(),
509
- legend: getDefaultSparklineLegend(),
510
- point: getDefaultSparklinePoint(),
511
- tooltip: getDefaultSparklineTooltip()
646
+ };
647
+ },
648
+ getDefaultPieSize = function () {
649
+ return {
650
+ height: 171, // produces a diameter of 150 and a centered chart when there is no legend
651
+ width: 171 // produces a diameter of 150 and a centered chart
652
+ };
653
+ },
654
+ getDefaultPieColors = function () {
655
+ return {
656
+ pattern: [
657
+ $.pfPaletteColors.blue,
658
+ $.pfPaletteColors.black300
659
+ ]
660
+ };
661
+ },
662
+ getDefaultPieTooltip = function () {
663
+ return {
664
+ contents: $().pfPieTooltipContents
665
+ };
666
+ },
667
+ getDefaultPieLegend = function () {
668
+ return {
669
+ show: false
670
+ };
671
+ },
672
+ getDefaultPieConfig = function () {
673
+ return {
674
+ pie: this.getDefaultPie(),
675
+ size: this.getDefaultPieSize(),
676
+ legend: this.getDefaultPieLegend(),
677
+ color: this.getDefaultPieColors(),
678
+ tooltip: this.getDefaultPieTooltip()
679
+ };
680
+ },
681
+ getDefaultSparklineArea = function () {
682
+ return {
683
+ zerobased: true
684
+ };
685
+ },
686
+ getDefaultSparklineSize = function () {
687
+ return {
688
+ height: 60
689
+ };
690
+ },
691
+ getDefaultSparklineAxis = function () {
692
+ return {
693
+ x: {
694
+ show: false
695
+ },
696
+ y: {
697
+ show: false
698
+ }
699
+ };
700
+ },
701
+ getDefaultSparklineLegend = function () {
702
+ return {
703
+ show: false
704
+ };
705
+ },
706
+ getDefaultSparklinePoint = function () {
707
+ return {
708
+ r: 1,
709
+ focus: {
710
+ expand: {
711
+ r: 4
712
+ }
713
+ }
714
+ };
715
+ },
716
+ getDefaultSparklineTooltip = function () {
717
+ return {
718
+ // because a sparkline should only contain a single data column,
719
+ // the tooltip will only work for a single data column
720
+ contents: function (d) {
721
+ return '<span class="c3-tooltip-sparkline">' + d[0].value + ' ' + d[0].name + '</span>';
722
+ }
723
+ };
724
+ },
725
+ getDefaultSparklineConfig = function () {
726
+ return {
727
+ area: getDefaultSparklineArea(),
728
+ size: getDefaultSparklineSize(),
729
+ axis: getDefaultSparklineAxis(),
730
+ color: getDefaultColors(),
731
+ legend: getDefaultSparklineLegend(),
732
+ point: getDefaultSparklinePoint(),
733
+ tooltip: getDefaultSparklineTooltip()
734
+ };
735
+ },
736
+ getDefaultLineAxis = function () {
737
+ return {
738
+ x: {
739
+ show: true
740
+ },
741
+ y: {
742
+ show: true
743
+ }
744
+ };
745
+ },
746
+ getDefaultLineGrid = function () {
747
+ return {
748
+ x: {
749
+ show: false
750
+ },
751
+ y: {
752
+ show: true
753
+ }
754
+ };
755
+ },
756
+ getDefaultLineLegend = function () {
757
+ return {
758
+ show: true
759
+ };
760
+ },
761
+ getDefaultLinePoint = function () {
762
+ return {
763
+ r: 3,
764
+ focus: {
765
+ expand: {
766
+ r: 5
767
+ }
768
+ }
769
+ };
770
+ },
771
+ getDefaultLineConfig = function () {
772
+ return {
773
+ axis: getDefaultLineAxis(),
774
+ grid: getDefaultLineGrid(),
775
+ color: getDefaultColors(),
776
+ legend: getDefaultLineLegend(),
777
+ point: getDefaultLinePoint()
778
+ };
779
+ },
780
+ getDefaultSingleLineTooltip = function () {
781
+ return {
782
+ contents: $().pfGetBarChartTooltipContentsFn()
783
+ };
784
+ },
785
+ getDefaultSingleLineLegend = function () {
786
+ return {
787
+ show: false
788
+ };
789
+ },
790
+ getDefaultSingleLineConfig = function () {
791
+ return {
792
+ axis: getDefaultLineAxis(),
793
+ grid: getDefaultLineGrid(),
794
+ color: getDefaultColors(),
795
+ legend: getDefaultSingleLineLegend(),
796
+ point: getDefaultLinePoint(),
797
+ tooltip: getDefaultSingleLineTooltip()
798
+ };
799
+ },
800
+ getDefaultAreaAxis = function () {
801
+ return getDefaultLineAxis();
802
+ },
803
+ getDefaultAreaGrid = function () {
804
+ return getDefaultLineGrid();
805
+ },
806
+ getDefaultAreaLegend = function () {
807
+ return getDefaultLineLegend();
808
+ },
809
+ getDefaultAreaPoint = function () {
810
+ return getDefaultLinePoint();
811
+ },
812
+ getDefaultAreaConfig = function () {
813
+ return {
814
+ axis: getDefaultAreaAxis(),
815
+ grid: getDefaultAreaGrid(),
816
+ color: getDefaultColors(),
817
+ legend: getDefaultAreaLegend(),
818
+ point: getDefaultAreaPoint()
819
+ };
820
+ },
821
+ getDefaultSingleAreaTooltip = function () {
822
+ return {
823
+ contents: $().pfGetBarChartTooltipContentsFn()
824
+ };
825
+ },
826
+ getDefaultSingleAreaLegend = function () {
827
+ return getDefaultSingleLineLegend();
828
+ },
829
+ getDefaultSingleAreaConfig = function () {
830
+ return {
831
+ axis: getDefaultAreaAxis(),
832
+ grid: getDefaultAreaGrid(),
833
+ color: getDefaultColors(),
834
+ legend: getDefaultSingleAreaLegend(),
835
+ point: getDefaultAreaPoint(),
836
+ tooltip: getDefaultSingleAreaTooltip()
837
+ };
512
838
  };
513
- };
514
-
515
839
  return {
516
840
  getDefaultColors: getDefaultColors,
841
+ getDefaultBarGrid: getDefaultBarGrid,
842
+ getDefaultBarTooltip: getDefaultBarTooltip,
843
+ getDefaultBarLegend: getDefaultBarLegend,
844
+ getDefaultBarConfig: getDefaultBarConfig,
845
+ getDefaultGroupedBarGrid: getDefaultGroupedBarGrid,
846
+ getDefaultGroupedBarLegend: getDefaultGroupedBarLegend,
847
+ getDefaultGroupedBarConfig: getDefaultGroupedBarConfig,
517
848
  getDefaultDonut: getDefaultDonut,
518
849
  getDefaultDonutSize: getDefaultDonutSize,
519
850
  getDefaultDonutColors: getDefaultDonutColors,
520
851
  getDefaultDonutTooltip: getDefaultDonutTooltip,
521
852
  getDefaultDonutLegend: getDefaultDonutLegend,
522
853
  getDefaultDonutConfig: getDefaultDonutConfig,
854
+ getDefaultPie: getDefaultPie,
855
+ getDefaultPieSize: getDefaultPieSize,
856
+ getDefaultPieColors: getDefaultPieColors,
857
+ getDefaultPieTooltip: getDefaultPieTooltip,
858
+ getDefaultPieLegend: getDefaultPieLegend,
859
+ getDefaultPieConfig: getDefaultPieConfig,
523
860
  getDefaultSparklineArea: getDefaultSparklineArea,
524
861
  getDefaultSparklineSize: getDefaultSparklineSize,
525
862
  getDefaultSparklineAxis: getDefaultSparklineAxis,
526
863
  getDefaultSparklineLegend: getDefaultSparklineLegend,
527
864
  getDefaultSparklinePoint: getDefaultSparklinePoint,
528
865
  getDefaultSparklineTooltip: getDefaultSparklineTooltip,
529
- getDefaultSparklineConfig: getDefaultSparklineConfig
866
+ getDefaultSparklineConfig: getDefaultSparklineConfig,
867
+ getDefaultLineAxis: getDefaultLineAxis,
868
+ getDefaultLineGrid: getDefaultLineGrid,
869
+ getDefaultLineLegend: getDefaultLineLegend,
870
+ getDefaultLinePoint: getDefaultLinePoint,
871
+ getDefaultLineConfig: getDefaultLineConfig,
872
+ getDefaultSingleLineTooltip: getDefaultSingleLineTooltip,
873
+ getDefaultSingleLineConfig: getDefaultSingleLineConfig,
874
+ getDefaultAreaAxis: getDefaultAreaAxis,
875
+ getDefaultAreaGrid: getDefaultAreaGrid,
876
+ getDefaultAreaLegend: getDefaultAreaLegend,
877
+ getDefaultAreaPoint: getDefaultAreaPoint,
878
+ getDefaultAreaConfig: getDefaultAreaConfig,
879
+ getDefaultSingleAreaTooltip: getDefaultSingleAreaTooltip,
880
+ getDefaultSingleAreaConfig: getDefaultSingleAreaConfig
530
881
  };
531
882
  };
532
883
  }(jQuery));
@@ -767,6 +1118,28 @@
767
1118
  navElement.find('.mobile-nav-item-pf').each(function (index, item) {
768
1119
  $(item).removeClass('mobile-nav-item-pf');
769
1120
  });
1121
+ } else {
1122
+ showSecondaryMenu();
1123
+ }
1124
+ },
1125
+
1126
+ updateSecondaryCollapsedState = function (setCollapsed, collapsedItem) {
1127
+ if (setCollapsed) {
1128
+ collapsedItem.addClass('collapsed');
1129
+ navElement.addClass('collapsed-secondary-nav-pf');
1130
+ bodyContentElement.addClass('collapsed-secondary-nav-pf');
1131
+ } else {
1132
+ if (collapsedItem) {
1133
+ collapsedItem.removeClass('collapsed');
1134
+ } else {
1135
+ // Remove any collapsed secondary menus
1136
+ navElement.find('[data-toggle="collapse-secondary-nav"]').each(function (index, element) {
1137
+ var $e = $(element);
1138
+ $e.removeClass('collapsed');
1139
+ });
1140
+ }
1141
+ navElement.removeClass('collapsed-secondary-nav-pf');
1142
+ bodyContentElement.removeClass('collapsed-secondary-nav-pf');
770
1143
  }
771
1144
  },
772
1145
 
@@ -784,6 +1157,9 @@
784
1157
  bodyContentElement.removeClass('collapsed-nav');
785
1158
  bodyContentElement.addClass('hidden-nav');
786
1159
 
1160
+ // Reset the secondary collapsed state
1161
+ updateSecondaryCollapsedState(false);
1162
+
787
1163
  explicitCollapse = false;
788
1164
  }
789
1165
  } else if (navElement.hasClass('hidden')) {
@@ -876,6 +1252,13 @@
876
1252
  });
877
1253
  },
878
1254
 
1255
+ forceHideSecondaryMenu = function () {
1256
+ navElement.addClass('force-hide-secondary-nav-pf');
1257
+ setTimeout(function () {
1258
+ navElement.removeClass('force-hide-secondary-nav-pf');
1259
+ }, 500);
1260
+ },
1261
+
879
1262
  bindMenuItemsBehavior = function (handleSelection) {
880
1263
  // Set main nav active item on click, and show secondary nav if it has a secondary nav bar
881
1264
  $(document).on('click.pf.secondarynav.data-api', '.nav-pf-vertical > .list-group > .list-group-item', function (element) {
@@ -908,8 +1291,7 @@
908
1291
 
909
1292
  // Set the active items on an item click
910
1293
  $e.on('click.pf.secondarynav.data-api', '.list-group > .list-group-item', function (event) {
911
- var $this = $(this);
912
- updateSecondaryMenuDisplayAfterSelection($this);
1294
+ updateSecondaryMenuDisplayAfterSelection();
913
1295
 
914
1296
  if (handleSelection) {
915
1297
  setSecondaryActiveItem($e, $(this));
@@ -920,12 +1302,25 @@
920
1302
 
921
1303
  // Collapse the secondary nav bar when the toggle is clicked
922
1304
  $e.on('click.pf.secondarynav.data-api', '[data-toggle="collapse-secondary-nav"]', function (e) {
923
- hideSecondaryMenu();
1305
+ var $this = $(this);
1306
+ if (inMobileState()) {
1307
+ hideSecondaryMenu();
1308
+ forceHideSecondaryMenu();
1309
+ } else {
1310
+ if ($this.hasClass('collapsed')) {
1311
+ updateSecondaryCollapsedState(false, $this);
1312
+ if ($(window).width() < breakpoints.desktop) {
1313
+ forceHideSecondaryMenu();
1314
+ }
1315
+ } else {
1316
+ if ($this.parents('.persistent-secondary.active').length > 0) {
1317
+ updateSecondaryCollapsedState(true, $this);
1318
+ } else {
1319
+ forceHideSecondaryMenu();
1320
+ }
1321
+ }
1322
+ }
924
1323
  navElement.removeClass('hover-secondary-nav-pf');
925
- navElement.addClass('force-hide-secondary-nav-pf');
926
- setTimeout(function () {
927
- navElement.removeClass('force-hide-secondary-nav-pf');
928
- }, 500);
929
1324
  if (handleSelection) {
930
1325
  // Don't process the click on the parent item
931
1326
  e.stopImmediatePropagation();