diff --git a/.idea/inspectionProfiles/iTop.xml b/.idea/inspectionProfiles/iTop.xml
index b7028562fc..263082e3ab 100644
--- a/.idea/inspectionProfiles/iTop.xml
+++ b/.idea/inspectionProfiles/iTop.xml
@@ -95,8 +95,9 @@
-
+
+
diff --git a/js/search/search_form_criteria.js b/js/search/search_form_criteria.js
index 7c8eac777f..b366734f8a 100644
--- a/js/search/search_form_criteria.js
+++ b/js/search/search_form_criteria.js
@@ -178,7 +178,6 @@ $(function()
// Update widget
this.options.operator = oActiveOpElem.find('.sfc_op_radio').val();
this.options.values = aValues;
- // TODO: Update title
this._setTitle();
// Trigger event to handler
@@ -339,7 +338,7 @@ $(function()
if(sTitle === undefined)
{
// TODO: Make nice label
- sTitle = this.options.field.label + ': ' + this._getValuesAsText();
+ sTitle = this.options.field.label + ' ' + this.operators[this.options.operator].label + ' ' + this._getValuesAsText();
}
this.element.find('.sfc_title').text(sTitle);
},
@@ -381,9 +380,24 @@ $(function()
oOpContentElem.val(this._getValuesAsText());
// Events
+ // - Focus input on click (radio, label, ...)
oOpElem.on('click', ':not(input[type="text"])', function(){
oOpContentElem.focus();
});
+ // - Apply on "enter" key hit
+ oOpContentElem.on('keyup', function(oEvent){
+ // Check operator's radio if not already
+ if(oOpElem.find('.sfc_op_radio').prop('checked') === false)
+ {
+ oOpElem.find('.sfc_op_radio').prop('checked', true)
+ }
+
+ // Apply if enter key
+ if(oEvent.key === 'Enter')
+ {
+ me._apply();
+ }
+ });
oOpElem.find('.sfc_op_content').append(oOpContentElem);
},
diff --git a/js/search/search_form_criteria_string.js b/js/search/search_form_criteria_string.js
index 7c0e9176d5..2a937effbd 100644
--- a/js/search/search_form_criteria_string.js
+++ b/js/search/search_form_criteria_string.js
@@ -70,26 +70,5 @@ $(function()
//------------------
// DOM element helpers
- // _prepareElement: function()
- // {
- // var me = this;
- //
- // this._super();
- //
- // // TODO: Refactor this after UI mockups
- // var oInputElem = $('');
- // oInputElem.on('change', function(){
- // var sValue = $(this).val();
- //
- // me.options.values = [{
- // value: sValue,
- // label: sValue,
- // }];
- // me._setTitle();
- //
- // me.handler.triggerHandler('itop.search.criteria.value_changed');
- // })
- // .appendTo(this.element.find('.sfc_form_group'));
- // },
});
});