]> arthur.barton.de Git - netdata.git/commitdiff
used perfect-scrollbar for the main menu and the my-netdata menu
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 29 Dec 2016 00:12:22 +0000 (02:12 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 29 Dec 2016 00:12:22 +0000 (02:12 +0200)
web/dashboard.js
web/index.html

index a1e3039ea13073f515c61afef5bef383bcc45f73..e69261f68feaf62d5a77731777660a14d28ac6f4 100644 (file)
@@ -501,9 +501,13 @@ var NETDATA = window.NETDATA || {};
     if(NETDATA.options.debug.main_loop === true)
         console.log('welcome to NETDATA');
 
+    NETDATA.onresizeCallback = null;
     NETDATA.onresize = function() {
         NETDATA.options.last_resized = Date.now();
         NETDATA.onscroll();
+
+        if(typeof NETDATA.onresizeCallback === 'function')
+            NETDATA.onresizeCallback();
     };
 
     NETDATA.onscroll_updater_count = 0;
index af99e96266e9be6ddcab002aa40a43f0fa9db885..6e976370946f90fcd5e735ce0251c41a8c7730f0 100644 (file)
 
             if(urlOptions.show_alarms === true)
                 setTimeout(function() { $('#alarmsModal').modal('show'); }, 1000);
+
+            var sidebar = document.getElementById('sidebar');
+            Ps.initialize(sidebar, {
+                wheelSpeed: 0.4,
+                wheelPropagation: true,
+                swipePropagation: true,
+                minScrollbarLength: null,
+                maxScrollbarLength: null,
+                useBothWheelAxes: false,
+                suppressScrollX: true,
+                suppressScrollY: false,
+                scrollXMarginOffset: 0,
+                scrollYMarginOffset: 0,
+                theme: 'default'
+            });
+            Ps.update(sidebar);
+
+            var registry = document.getElementById('registry-dropdown');
+            Ps.initialize(registry, {
+                wheelSpeed: 0.4,
+                wheelPropagation: false,
+                swipePropagation: false,
+                minScrollbarLength: null,
+                maxScrollbarLength: null,
+                useBothWheelAxes: false,
+                suppressScrollX: true,
+                suppressScrollY: false,
+                scrollXMarginOffset: 0,
+                scrollYMarginOffset: 0,
+                theme: 'default'
+            });
+            Ps.update(registry);
+
+            NETDATA.onresizeCallback = function() {
+                Ps.update(sidebar);
+                Ps.update(registry);
+            };
         }
 
         function resetDashboardOptions() {
                 if(urlOptions.update_always === true)
                     NETDATA.setOption('stop_updates_when_focus_is_lost', !urlOptions.update_always);
             }
-        }
+        };
 
         // our entry point
         var netdataCallback = initializeDynamicDashboard;
                 <ul class="nav navbar-nav">
                     <li class="dropdown">
                         <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">my-netdata <strong class="caret"></strong></a>
-                        <ul class="dropdown-menu scrollable-menu inpagemenu multi-column columns-2" role="menu">
+                        <ul class="dropdown-menu scrollable-menu inpagemenu multi-column columns-2" role="menu" id="registry-dropdown">
                             <div class="row">
                                 <div class="col-sm-6" style="width: 85%; padding-right: 0;">
                                     <ul id="mynetdata_servers" class="multi-column-dropdown">
             <div class="charts-body" role="main">
                 <div id="charts_div"></div>
             </div>
-            <div class="sidebar-body hidden-xs hidden-sm" role="complementary">
+            <div class="sidebar-body hidden-xs hidden-sm" id="sidebar-body" role="complementary">
                 <nav class="dashboard-sidebar hidden-print hidden-xs hidden-sm" id="sidebar" role="menu"></nav>
             </div>
         </div>
     </div>
 </body>
 </html>
-<script type="text/javascript" src="dashboard.js?v20161229-1"></script>
+<script type="text/javascript" src="dashboard.js?v20161229-2"></script>