diff --git a/css/light-grey.css b/css/light-grey.css
index 0a1276221..c008dd40a 100644
--- a/css/light-grey.css
+++ b/css/light-grey.css
@@ -875,6 +875,9 @@ input.dp-applied {
.search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group .sfc_fg_operators .sfc_fg_operator {
/* Common operators for most criteria types processing*/
}
+.search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group .sfc_fg_operators .sfc_fg_operator.force_hide {
+ display: none !important;
+}
.search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group .sfc_fg_operators .sfc_fg_operator > label {
line-height: 20px;
white-space: nowrap;
diff --git a/css/light-grey.scss b/css/light-grey.scss
index e4993e40c..64958cd62 100644
--- a/css/light-grey.scss
+++ b/css/light-grey.scss
@@ -977,6 +977,10 @@ input.dp-applied {
font-size: 12px;
.sfc_fg_operator{
+ &.force_hide {
+ display: none !important;
+ }
+
> label{
line-height: 20px;
white-space: nowrap;
diff --git a/js/search/search_form_criteria_numeric.js b/js/search/search_form_criteria_numeric.js
index 91c8b4463..8b4802581 100644
--- a/js/search/search_form_criteria_numeric.js
+++ b/js/search/search_form_criteria_numeric.js
@@ -94,68 +94,106 @@ $(function()
this._super( key, value );
},
+
+ // // Prepare operator's DOM element
+ // _prepareBetweenOperator: function(oOpElem, sOpIdx, oOp)
+ // {
+ // var me = this;
+ //
+ // // DOM element
+ // var oOpContentElem = $('');
+ // 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 (typically when focusing in input via "tab" key)
+ // if(oOpElem.find('.sfc_op_radio').prop('checked') === false)
+ // {
+ // oOpElem.find('.sfc_op_radio').prop('checked', true)
+ // }
+ //
+ // me._markAsDraft();
+ //
+ // // Apply if enter key
+ // if(oEvent.key === 'Enter')
+ // {
+ // me._apply();
+ // }
+ // });
+ //
+ // oOpElem.find('.sfc_op_content').append(oOpContentElem);
+ // },
+
//------------------
// Inherited methods
//------------------
- //
- // // Prepare operator's DOM element
- // // - Base preparation, always called
- // _prepareOperator: function(oOpElem, sOpIdx, oOp)
- // {
- // var me = this;
- // if (typeof oOp.dropdown_group == 'undefined')
- // {
- // return this._super(oOpElem, sOpIdx, oOp);
- // }
- //
- // this._super(oOpElem, sOpIdx, oOp);
- // oOpElem.addClass('force_hide')
- //
- // // DOM element
- // oDropdown = this.element.find('select.dropdown_group_'+oOp.dropdown_group);
- // if (oDropdown.length == 0)
- // {
- // oDropdown = $('');
- //
- // oDropdown.on('change', function(){
- // $option = $(this);
- // this.element.find('.sfc_op_radio').val($option.val());
- //
- // oOptionOp = $option.data('oOp');
- // $option.attr('data-operator-code', oOptionOp.code);
- // });
- //
- //
- // // Create DOM element from template
- // var oOpElemDropdown = $(this._getOperatorTemplate()).uniqueId();
- //
- // oOpElemDropdown
- // .addClass('sfc_fg_operator_dropdown_group')
- // .data('data-operator-code', 'dropdown_group')
- // .find('.sfc_op_name')
- // .append(oDropdown)
- // .end()
- // .find('.sfc_op_radio')
- // .val(sOpIdx)
- // .end()
- // .on('click', function(){
- // var bIsChecked = oOpElemDropdown.find('.sfc_op_radio').prop('checked');
- //
- // if(bIsChecked === false)
- // {
- // oOpElemDropdown.find('.sfc_op_radio').prop('checked', true);
- // me._markAsDraft();
- // }
- // })
- // .appendTo(this.element.find('.sfc_fg_operators'));
- // }
- //
- // oDropdown
- // .append('')
- // .data('oOp', oOp)
- // ;
- // },
+
+ // Prepare operator's DOM element
+ // - Base preparation, always called
+ _prepareOperator: function(oOpElem, sOpIdx, oOp)
+ {
+ var me = this;
+ if (typeof oOp.dropdown_group == 'undefined')
+ {
+ return this._super(oOpElem, sOpIdx, oOp);
+ }
+
+ this._super(oOpElem, sOpIdx, oOp);
+ oOpElem.addClass('force_hide')
+
+ // DOM element
+ oDropdown = this.element.find('select.dropdown_group_'+oOp.dropdown_group);
+ if (oDropdown.length == 0)
+ {
+ oDropdown = $('');
+
+ oDropdown.on('change', function(){
+ $option = $(this);
+ me.element.find('.sfc_op_radio').val($option.val());
+
+ oOptionOp = $option.data('oOp');
+ $option.attr('data-operator-code', oOptionOp.code);
+ });
+
+
+ // Create DOM element from template
+ var oOpElemDropdown = $(this._getOperatorTemplate()).uniqueId();
+
+ oOpElemDropdown
+ .addClass('sfc_fg_operator_dropdown_group')
+ .attr('data-operator-code', 'dropdown_group')
+ .find('.sfc_op_name')
+ .append(oDropdown)
+ .end()
+ .find('.sfc_op_radio')
+ .val(sOpIdx)
+ .end()
+ .on('click', function(){
+ var bIsChecked = oOpElemDropdown.find('.sfc_op_radio').prop('checked');
+
+ if(bIsChecked === false)
+ {
+ oOpElemDropdown.find('.sfc_op_radio').prop('checked', true);
+ me._markAsDraft();
+ }
+ })
+ .appendTo(this.element.find('.sfc_fg_operators'))
+ ;
+
+ this._prepareDefaultOperator(oOpElemDropdown, sOpIdx, oOp);
+ }
+
+ oDropdown
+ .append('')
+ .data('oOp', oOp)
+ ;
+ },
});