@cryptotaxi247 / netdata-1 / commits / ee1cfd4ca

used perfect-scrollbar for the main menu and the my-netdata menu

Costa Tsaousis (ktsaou) committed Dec 29, 2016 at 02:12 UTC ee1cfd4ca41c1c2625a3a5b911ff48861309ffd1
2 files changed +45 -4
web/dashboard.js
+4
@@ -501,9 +501,13 @@ var NETDATA = window.NETDATA || {};
501 if(NETDATA.options.debug.main_loop === true)
502 console.log('welcome to NETDATA');
503
504 + NETDATA.onresizeCallback = null;
505 NETDATA.onresize = function() {
506 NETDATA.options.last_resized = Date.now();
507 NETDATA.onscroll();
508 +
509 + if(typeof NETDATA.onresizeCallback === 'function')
510 + NETDATA.onresizeCallback();
511 };
512
513 NETDATA.onscroll_updater_count = 0;
web/index.html
+41 -4
@@ -2535,6 +2535,43 @@
2535
2536 if(urlOptions.show_alarms === true)
2537 setTimeout(function() { $('#alarmsModal').modal('show'); }, 1000);
2538 +
2539 + var sidebar = document.getElementById('sidebar');
2540 + Ps.initialize(sidebar, {
2541 + wheelSpeed: 0.4,
2542 + wheelPropagation: true,
2543 + swipePropagation: true,
2544 + minScrollbarLength: null,
2545 + maxScrollbarLength: null,
2546 + useBothWheelAxes: false,
2547 + suppressScrollX: true,
2548 + suppressScrollY: false,
2549 + scrollXMarginOffset: 0,
2550 + scrollYMarginOffset: 0,
2551 + theme: 'default'
2552 + });
2553 + Ps.update(sidebar);
2554 +
2555 + var registry = document.getElementById('registry-dropdown');
2556 + Ps.initialize(registry, {
2557 + wheelSpeed: 0.4,
2558 + wheelPropagation: false,
2559 + swipePropagation: false,
2560 + minScrollbarLength: null,
2561 + maxScrollbarLength: null,
2562 + useBothWheelAxes: false,
2563 + suppressScrollX: true,
2564 + suppressScrollY: false,
2565 + scrollXMarginOffset: 0,
2566 + scrollYMarginOffset: 0,
2567 + theme: 'default'
2568 + });
2569 + Ps.update(registry);
2570 +
2571 + NETDATA.onresizeCallback = function() {
2572 + Ps.update(sidebar);
2573 + Ps.update(registry);
2574 + };
2575 }
2576
2577 function resetDashboardOptions() {
@@ -2574,7 +2611,7 @@
2611 if(urlOptions.update_always === true)
2612 NETDATA.setOption('stop_updates_when_focus_is_lost', !urlOptions.update_always);
2613 }
2577 - }
2614 + };
2615
2616 // our entry point
2617 var netdataCallback = initializeDynamicDashboard;
@@ -2595,7 +2632,7 @@
2632 <ul class="nav navbar-nav">
2633 <li class="dropdown">
2634 <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">my-netdata <strong class="caret"></strong></a>
2598 - <ul class="dropdown-menu scrollable-menu inpagemenu multi-column columns-2" role="menu">
2635 + <ul class="dropdown-menu scrollable-menu inpagemenu multi-column columns-2" role="menu" id="registry-dropdown">
2636 <div class="row">
2637 <div class="col-sm-6" style="width: 85%; padding-right: 0;">
2638 <ul id="mynetdata_servers" class="multi-column-dropdown">
@@ -2682,7 +2719,7 @@
2719 <div class="charts-body" role="main">
2720 <div id="charts_div"></div>
2721 </div>
2685 - <div class="sidebar-body hidden-xs hidden-sm" role="complementary">
2722 + <div class="sidebar-body hidden-xs hidden-sm" id="sidebar-body" role="complementary">
2723 <nav class="dashboard-sidebar hidden-print hidden-xs hidden-sm" id="sidebar" role="menu"></nav>
2724 </div>
2725 </div>
@@ -3186,4 +3223,4 @@
3223 </div>
3224 </body>
3225 </html>
3189 -<script type="text/javascript" src="dashboard.js?v20161229-1"></script>
3226 +<script type="text/javascript" src="dashboard.js?v20161229-2"></script>