Fruit of Eden 6 years ago
parent
commit
266eaba726
3 changed files with 21 additions and 13 deletions
  1. 4 2
      js/admin.js
  2. 1 1
      js/basic.js
  3. 16 10
      lazhang.html

+ 4 - 2
js/admin.js

@@ -124,8 +124,10 @@ $.AdminBSB.leftSideBar = {
 
             //Scroll active menu item when page load, if option set = true
             if ($.AdminBSB.options.leftSideBar.scrollActiveItemWhenPageLoad) {
-                var activeItemOffsetTop = $('.menu .list li.active')[0].offsetTop
-                if (activeItemOffsetTop > 150) $el.slimscroll({ scrollTo: activeItemOffsetTop + 'px' });
+                if($('.menu .list li.active')[0] !== undefined) {
+                    var activeItemOffsetTop = $('.menu .list li.active')[0].offsetTop
+                    if (activeItemOffsetTop > 150) $el.slimscroll({scrollTo: activeItemOffsetTop + 'px'});
+                }
             }
         }
     },

+ 1 - 1
js/basic.js

@@ -1,4 +1,4 @@
-var SVR_URL = "http://172.30.84.3:8803/server/";
+var SVR_URL = "/server/";  //http://172.30.84.3:8803
 
 function get_data(url, callback) {
     $.ajax({

+ 16 - 10
lazhang.html

@@ -124,9 +124,10 @@
 
     </div>
 </nav>
-<section class="content" style-height="20" style="margin: 0 auto; margin-top: 4em">
+<section class="content"  style="margin: 0 auto;">
+    <div class="row" style-height="10"></div>
     <div class="container-fluid " style="margin-bottom: 1em">
-        <div class="row text-center">
+        <div style-height="20" class="row text-center">
             <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
                 <div class="info-box bg-green hover-expand-effect" style="margin: 0;">
                     <div class="icon">
@@ -181,7 +182,6 @@
             </div>
 
         </div>
-
     </div>
     <div class="container-fluid" style="margin-top: 0.5em;padding-top: 1em">
         <div id="graph-1" style-height="30"></div>
@@ -281,7 +281,7 @@
 
 <!-- Custom Js -->
 <script src="js/admin.js"></script>
-<script src="js/pages/index.js"></script>
+<!--<script src="js/pages/index.js"></script>-->
 
 <!-- Demo Js -->
 <script src="js/demo.js"></script>
@@ -477,15 +477,21 @@
         $('[style-height="20"]').height(window.innerHeight / 5);
         $('[style-height="30"]').height(window.innerHeight / 3.33333);
         $('[style-height="40"]').height(window.innerHeight / 2.5);
-        (function(){
-            $('#graph-1').highcharts().reflow();
-        })();
+        var graph = $("#graph-1");
+        graph.width(window.innerWidth);
+        graph.height(window.innerHeight / 3.333);
+        if(graph.highcharts !== undefined) {
+            graph.highcharts().reflow();
+        }
     }
 
     setInterval(function(){
-        $("#graph-1").width(window.innerWidth);
-        $("#graph-1").height(window.innerHeight / 3.333);
-    },1000);
+        resizeAll();
+    },5000);
+
+    resizeAll();
+
+    startClock();
 
 </script>
 </body>