浏览代码

HUE-7641 [dashboard] Properly align download facet icon in SQL dashboard

jdesjean 8 年之前
父节点
当前提交
24ba2de

+ 2 - 1
desktop/core/src/desktop/templates/common_notebook_ko_components.mako

@@ -169,7 +169,7 @@ except ImportError, e:
     </form>
 
     <div class="hover-dropdown" data-bind="visible: snippet.status() == 'available' && snippet.result.hasSomeResults() && snippet.result.type() == 'table'" style="display:none;">
-      <a class="snippet-side-btn inactive-action dropdown-toggle pointer" style="padding-right:0" data-toggle="dropdown" title="${ _('Export results') }">
+      <a class="inactive-action dropdown-toggle pointer" style="padding-right:0" data-toggle="dropdown" title="${ _('Export results') }" data-bind="css: {'grid-side-btn': gridSideBtn, 'snippet-side-btn': !gridSideBtn()}">
         <!-- ko ifnot: isDownloading -->
         <i class="fa fa-fw fa-download"></i>
         <!-- /ko -->
@@ -323,6 +323,7 @@ except ImportError, e:
         self.$downloadForm = $(element).find(".download-form");
         self.snippet = params.snippet;
         self.notebook = params.notebook;
+        self.gridSideBtn = ko.observable(params.gridSideBtn);
 
         self.saveTarget = ko.observable('hdfs-file');
         self.savePath = ko.observable('');

+ 1 - 1
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -1379,7 +1379,7 @@ ${ dashboard.layout_skeleton(suffix='search') }
         </div>
 
         <!-- ko if: $root.collection.engine() != 'solr' -->
-          <div data-bind="component: { name: 'downloadSnippetResults', params: { snippet: $data.queryResult(), notebook: {getContext: function() { return {type: $data.queryResult().type(), id: 1}; }} } }" style="display:inline-block;"></div>
+          <div data-bind="component: { name: 'downloadSnippetResults', params: { gridSideBtn: true, snippet: $data.queryResult(), notebook: {getContext: function() { return {type: $data.queryResult().type(), id: 1}; }} } }" style="display:inline-block;"></div>
         <!-- /ko -->
 
         <!-- ko if: $root.collection.engine() == 'solr' -->

+ 1 - 1
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -1854,7 +1854,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
     </div>
 
     % if conf.ENABLE_DOWNLOAD.get():
-    <div data-bind="component: { name: 'downloadSnippetResults', params: { snippet: $data, notebook: $parent } }" style="display:inline-block;"></div>
+    <div data-bind="component: { name: 'downloadSnippetResults', params: { gridSideBtn: false, snippet: $data, notebook: $parent } }" style="display:inline-block;"></div>
     % endif
   </div>
 </script>