Эх сурвалжийг харах

HUE-5770 [search] Extended property to numeric and changed binding to textInput

Enrico Berti 8 жил өмнө
parent
commit
4786d36

+ 1 - 1
apps/search/src/search/static/search/js/search.ko.js

@@ -483,7 +483,7 @@ var Collection = function (vm, collection) {
   };
   self.enabled = ko.mapping.fromJS(collection.enabled);
   self.autorefresh = ko.mapping.fromJS(collection.autorefresh);
-  self.autorefreshSeconds = ko.mapping.fromJS(collection.autorefreshSeconds || 60).extend("throttle", 1000);
+  self.autorefreshSeconds = ko.mapping.fromJS(collection.autorefreshSeconds || 60).extend({ numeric: 0, throttle: 1000 });
   self.idField = ko.observable(collection.idField);
   self.timeFilter = ko.mapping.fromJS(collection.timeFilter);
   self.timeFilter.value.subscribe(function () {

+ 5 - 5
apps/search/src/search/templates/common_search.mako

@@ -2699,16 +2699,16 @@ ${ dashboard.layout_skeleton() }
               </div>
               <div class="control-group">
                 <div class="controls">
-                  <label class="checkbox">
-                    <input type="checkbox" style="margin-right: 4px; margin-top: 9px" data-bind="checked: $root.collection.autorefresh"/> ${ _('Auto-refresh every') } <input type="number" class="input-mini" style="margin-bottom: 0; margin-left: 6px; margin-right: 6px; width: 46px; text-align:center" data-bind="value: $root.collection.autorefreshSeconds"/> ${ _('seconds') }
+                  <label class="checkbox inline-block">
+                    <input type="checkbox" style="margin-right: 4px; margin-top: 9px" data-bind="checked: $root.collection.autorefresh"/> ${ _('Auto-refresh every') } <input type="number" class="input-mini" style="margin-bottom: 0; margin-left: 6px; margin-right: 6px; width: 46px; text-align:center" data-bind="textInput: $root.collection.autorefreshSeconds"/> ${ _('seconds') }
                   </label>
                 </div>
               </div>
             </span>
 
             <!-- ko if: $root.availableDateFields().length == 0 -->
-              <label class="checkbox">
-                <input type="checkbox" style="margin-right: 4px; margin-top: 9px" data-bind="checked: $root.collection.autorefresh"/> ${ _('Auto-refresh every') } <input type="number" class="input-mini" style="margin-bottom: 0; margin-left: 6px; margin-right: 6px; width: 46px; text-align:center" data-bind="value: $root.collection.autorefreshSeconds"/> ${ _('seconds') }
+              <label class="checkbox inline-block">
+                <input type="checkbox" style="margin-right: 4px; margin-top: 9px" data-bind="checked: $root.collection.autorefresh"/> ${ _('Auto-refresh every') } <input type="number" class="input-mini" style="margin-bottom: 0; margin-left: 6px; margin-right: 6px; width: 46px; text-align:center" data-bind="textInput: $root.collection.autorefreshSeconds"/> ${ _('seconds') }
               </label>
             <!-- /ko -->
           </fieldset>
@@ -3547,7 +3547,7 @@ $(document).ready(function () {
 
   var _refreshTimeout = null;
 
-  viewModel.collection.autorefresh.subscribe(function (value) { 
+  viewModel.collection.autorefresh.subscribe(function (value) {
     if (value) {
       refresh();
     }