فهرست منبع

HUE-3808 [core] Do not trigger any call on initialization

Also apply the binding only on the top main bar.
Romain Rigaux 10 سال پیش
والد
کامیت
8e25f49
1فایلهای تغییر یافته به همراه6 افزوده شده و 4 حذف شده
  1. 6 4
      desktop/core/src/desktop/templates/logs.mako

+ 6 - 4
desktop/core/src/desktop/templates/logs.mako

@@ -99,10 +99,12 @@ ${layout.menubar(section='log_view')}
   var LiveDebugging = function () {
     var self = this;
 
-    self.forcedDebug = ko.observable(false);
+    self.forcedDebug = ko.observable();
     self.forcedDebug.subscribe(function(newValue) {
-      self.toggleLogLevel();
-    });
+      if (newValue != null) {
+        self.toggleLogLevel();
+      }
+    }, this, "beforeChange");
 
     self.getDebugLevel = function() {
       $.get("/desktop/get_debug_level", function(data) { self.forcedDebug(data.debug_all); });
@@ -130,7 +132,7 @@ ${layout.menubar(section='log_view')}
 
   $(document).ready(function () {
     viewModel = new LiveDebugging();
-    ko.applyBindings(viewModel);
+    ko.applyBindings(viewModel, $(".action-main-bar")[0]);
 
     viewModel.getDebugLevel();