浏览代码

HUE-6077 [frontend] Avoid opening history and job panels at the same time

Enrico Berti 8 年之前
父节点
当前提交
589853b

文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue.css


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue3-extra.css


+ 5 - 1
desktop/core/src/desktop/static/desktop/less/hue-cui-overrides.less

@@ -51,4 +51,8 @@
 .modal {
   width: 620px;
   margin-left: -310px;
-}
+}
+
+.btn:focus {
+  outline: none;
+}

+ 0 - 2
desktop/core/src/desktop/templates/hue.mako

@@ -985,8 +985,6 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
         self.searchActive = ko.observable(false);
         self.searchHasFocus = ko.observable(false);
         self.searchInput = ko.observable();
-        self.jobsPanelVisible = ko.observable(false);
-        self.historyPanelVisible = ko.observable(false);
 
         self.searchAutocompleteSource = function (request, callback) {
           // TODO: Extract complete contents to common module (shared with nav search autocomplete)

+ 24 - 2
desktop/core/src/desktop/templates/ko_components.mako

@@ -167,7 +167,7 @@ from desktop.views import _ko
     </button>
 
     <div class="jobs-panel" data-bind="visible: historyPanelVisible" style="display: none;">
-      <a class="pointer pull-right" data-bind="click: function(){ historyPanelVisible(false); }"><i class="fa fa-times"></i></a>
+      <a class="pointer inactive-action pull-right" data-bind="click: function(){ historyPanelVisible(false); }"><i class="fa fa-fw fa-times"></i></a>
       <!-- ko if: editorViewModel.selectedNotebook() -->
       <!-- ko with: editorViewModel.selectedNotebook() -->
       <div>
@@ -260,6 +260,16 @@ from desktop.views import _ko
         var self = this;
         self.historyPanelVisible = ko.observable(false);
 
+        self.historyPanelVisible.subscribe(function (newVal) {
+          if (newVal) {
+            huePubSub.publish('hide.jobs.panel');
+          }
+        });
+
+        huePubSub.subscribe('hide.history.panel', function () {
+          self.historyPanelVisible(false);
+        });
+
         self.editorViewModel = new EditorViewModel(null, '', {
           user: '${ user.username }',
           userId: ${ user.id },
@@ -368,7 +378,8 @@ from desktop.views import _ko
       <div id="jobBrowserCount" class="jobs-badge" title="${_('Running jobs')}" data-bind="visible: jobCount() > 0, text: jobCount">0</div>
     </button>
     <div class="jobs-panel" data-bind="visible: jobsPanelVisible" style="display: none;">
-      <a href="javascript:void(0)" class="inactive-action pull-right" data-bind="click: function(){ page('/jobbrowser/'); jobsPanelVisible(false); }"><i class="fa fa-expand" title="${ _('Open Job Browser') }"></i></a>
+      <a class="pointer inactive-action pull-right" data-bind="click: function(){ jobsPanelVisible(false); }"><i class="fa fa-fw fa-times"></i></a>
+      <a class="pointer inactive-action pull-right" data-bind="click: function(){ page('/jobbrowser/'); jobsPanelVisible(false); }"><i class="fa fa-fw fa-expand" title="${ _('Open Job Browser') }"></i></a>
       <span style="font-size: 15px; font-weight: 300">${_('Jobs')} | ${_('Workflows')} | ${_('Schedules')}</span>
       <div id="mini_jobbrowser"></div>
     </div>
@@ -382,6 +393,17 @@ from desktop.views import _ko
         var self = this;
 
         self.jobsPanelVisible = ko.observable(false);
+
+        self.jobsPanelVisible.subscribe(function (newVal) {
+          if (newVal) {
+            huePubSub.publish('hide.history.panel');
+          }
+        });
+
+        huePubSub.subscribe('hide.jobs.panel', function () {
+          self.jobsPanelVisible(false);
+        });
+
         self.jobCount = ko.observable(0);
         self.onePageViewModel = params.onePageViewModel;
 

部分文件因为文件数量过多而无法显示