Browse Source

HUE-7732 [editor] Change select variables from datalist to selectize

jdesjean 7 năm trước cách đây
mục cha
commit
1b65ad8

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
desktop/libs/notebook/src/notebook/static/notebook/css/notebook.css


+ 17 - 0
desktop/libs/notebook/src/notebook/static/notebook/less/notebook.less

@@ -1274,4 +1274,21 @@
   .statement-type-selector > .hue-drop-down-container {
     margin-left: -100px;
   }
+
+  .variables .selectize-control {
+    display: inline-block;
+    width: 164px;
+  }
+
+  .variables .selectize-input {
+    line-height: 19px;
+  }
+
+  .variables .selectize-input input[type="text"] {
+    height: 19px;
+  }
+
+  .variables .input-prepend {
+    line-height: 0px;
+  }
 }

+ 2 - 5
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -1201,11 +1201,8 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
           <!-- ko if: meta.type() == 'text' -->
           <input class="input-medium" type="text" data-bind="value: value, attr: { placeholder: meta.placeholder() || '${ _ko('Variable value') }' }, valueUpdate: 'afterkeydown', autogrowInput: { minWidth: 150, maxWidth: 270, comfortZone: 15 }, event: { 'keydown': $parent.onKeydownInVariable }">
           <!-- /ko -->
-          <!-- ko if: meta.type() == 'select' && !('options' in document.createElement('datalist')) -->
-          <select data-bind="options: meta.options(), optionsText: 'text', optionsValue:'value', value: value, attr: { placeholder: meta.placeholder() || '${ _ko('Variable value') }' }, event: { 'keydown': $parent.onKeydownInVariable }"/>
-          <!-- /ko -->
-          <!-- ko if: meta.type() == 'select' && 'options' in document.createElement('datalist') -->
-          <input list="input-medium" type="text" data-bind="datalist: { options: meta.options(), optionsText: 'text', optionsValue: 'value', value: value }, valueUpdate: 'afterkeydown', autogrowInput: { minWidth: 150, maxWidth: 270, comfortZone: 15 }, attr: { placeholder: meta.placeholder() || '${ _ko('Variable value') }' }, event: { 'keydown': $parent.onKeydownInVariable }" />
+          <!-- ko if: meta.type() == 'select' -->
+          <select data-bind="selectize: meta.options(), optionsText: 'text', optionsValue:'value', value: value, event: { 'keydown': $parent.onKeydownInVariable }"/>
           <!-- /ko -->
         </div>
       </li>

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác