Browse Source

Merge remote-tracking branch 'origin/master' into develop

Conflicts:
	src/app/directives/grafanaPanel.js
	src/app/features/dashboard/dashboardCtrl.js
Torkel Ödegaard 10 năm trước cách đây
mục cha
commit
f817a8ca3c

+ 5 - 0
src/app/directives/templateParamSelector.js

@@ -75,6 +75,11 @@ function (angular, app, _, $) {
             $button.focus();
           });
 
+          $scope.$on('$destroy', function() {
+            $button.unbind();
+            typeahead.destroy();
+          });
+
           $compile(elem.contents())($scope);
         }
       };

+ 10 - 7
src/app/features/dashboard/dashboardCtrl.js

@@ -31,13 +31,6 @@ function (angular, $, config) {
       $scope.setupDashboard(dashboard);
     };
 
-    $scope.registerWindowResizeEvent = function() {
-      angular.element(window).bind('resize', function() {
-        $timeout.cancel(resizeEventTimeout);
-        resizeEventTimeout = $timeout(function() { $scope.$broadcast('render'); }, 200);
-      });
-    };
-
     $scope.setupDashboard = function(dashboard) {
       $rootScope.performance.dashboardLoadStart = new Date().getTime();
       $rootScope.performance.panelsInitialized = 0;
@@ -123,5 +116,15 @@ function (angular, $, config) {
       $rootScope.$broadcast('render');
     };
 
+    $scope.registerWindowResizeEvent = function() {
+      angular.element(window).bind('resize', function() {
+        $timeout.cancel(resizeEventTimeout);
+        resizeEventTimeout = $timeout(function() { $scope.$broadcast('render'); }, 200);
+      });
+      $scope.$on('$destroy', function() {
+        angular.element(window).unbind('resize');
+      });
+    };
+
   });
 });

+ 6 - 1
src/vendor/bootstrap/bootstrap.js

@@ -1956,7 +1956,7 @@
       return items ? this.process(items) : this
     }
 
-  , process: function (items) {
+    , process: function (items) {
       var that = this
 
       items = $.grep(items, function (item) {
@@ -2050,6 +2050,11 @@
         .on('click', $.proxy(this.click, this))
         .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
         .on('mouseleave', 'li', $.proxy(this.mouseleave, this))
+    },
+
+    destroy: function () {
+      this.$element.off().removeData('typeahead');
+      this.$menu.off();
     }
 
   , eventSupported: function(eventName) {

+ 1 - 1
src/views/index.html

@@ -22,7 +22,7 @@
 
 		<!-- build:js app/app.js -->
     <script src="[[.AppSubUrl]]/public/vendor/require/require.js"></script>
-    <script src="[[.AppSubUrl]]/public/app/components/require.backend.js"></script>
+    <script src="[[.AppSubUrl]]/public/app/components/require.config.js"></script>
     <!-- endbuild -->
   </head>