diff --git a/css/light-grey.css b/css/light-grey.css index f46ed2059f..389c48217c 100644 --- a/css/light-grey.css +++ b/css/light-grey.css @@ -784,16 +784,23 @@ div.HRDrawer { .search_form_handler .sf_criterion_area .search_form_criteria { display: inline-block; margin-right: 3px; + /* Special criterion processing */ } .search_form_handler .sf_criterion_area .search_form_criteria.locked { background-color: #f1f1f1; } +.search_form_handler .sf_criterion_area .search_form_criteria .sfc_title { + cursor: pointer; +} .search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group { display: none; } .search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group.opened { display: block; } +.search_form_handler .sf_criterion_area .search_form_criteria.search_form_criteria_raw .sfc_title { + cursor: initial; +} .search_form_handler .sf_criterion_area .sf_more_criterion .sf_mc_list { position: absolute; margin: 0px; diff --git a/css/light-grey.scss b/css/light-grey.scss index 063cd959ce..ef223d1029 100644 --- a/css/light-grey.scss +++ b/css/light-grey.scss @@ -885,7 +885,7 @@ div.HRDrawer { } } .sfc_title{ - + cursor: pointer; } .sfc_form_group{ display: none; @@ -894,6 +894,13 @@ div.HRDrawer { display: block; } } + + /* Special criterion processing */ + &.search_form_criteria_raw{ + .sfc_title{ + cursor: initial; + } + } } /* More criterion */ diff --git a/js/search/search_form_criteria.js b/js/search/search_form_criteria.js index 443257d583..4244f716c3 100644 --- a/js/search/search_form_criteria.js +++ b/js/search/search_form_criteria.js @@ -141,27 +141,31 @@ $(function() // Fill criteria this._setTitle(); }, + // - Set the title element _setTitle: function(sTitle) { if(sTitle === undefined) { // TODO: Make nice label + sTitle = this.options.field.label + ': ' + this._getValuesAsText(); } this.element.find('.sfc_title').text(sTitle); }, // Values helpers + // - Convert values to a standard string _getValuesAsText: function() { var aValues = []; for(var iValueIdx in this.options.values) { - aValues.push(this.options.values[iValueIdx].value); + aValues.push(this.options.values[iValueIdx].label); } return aValues.join(', '); }, + // - Make an OQL expression from the criteria values and operator _makeOQLExpression: function() { var aValues = []; diff --git a/js/search/search_form_criteria_raw.js b/js/search/search_form_criteria_raw.js index 0d09359042..3e91bf6e45 100644 --- a/js/search/search_form_criteria_raw.js +++ b/js/search/search_form_criteria_raw.js @@ -43,6 +43,10 @@ $(function() this._super( key, value ); }, + //------------------ + // Inherited methods + //------------------ + // DOM element helpers _prepareElement: function() { diff --git a/js/search/search_form_criteria_string.js b/js/search/search_form_criteria_string.js index 5035772c6d..883b2c73af 100644 --- a/js/search/search_form_criteria_string.js +++ b/js/search/search_form_criteria_string.js @@ -9,6 +9,7 @@ $(function() // default options options: { + operator: 'contains', }, // the constructor @@ -43,6 +44,10 @@ $(function() this._super( key, value ); }, + //------------------ + // Inherited methods + //------------------ + // DOM element helpers _prepareElement: function() { @@ -65,13 +70,5 @@ $(function() }) .appendTo(this.element.find('.sfc_form_group')); }, - _setTitle: function(sTitle) - { - if(sTitle === undefined) - { - sTitle = this.options.field.label + ': ' + this._getValuesAsText(); - } - this._super(sTitle); - }, }); }); diff --git a/js/search/search_form_handler.js b/js/search/search_form_handler.js index 5a226edab2..520dd31672 100644 --- a/js/search/search_form_handler.js +++ b/js/search/search_form_handler.js @@ -339,6 +339,8 @@ $(function() // Show loader this._showLoader(); + // TODO: Make a throttle mecanism or cancel previous call when a newer is made. + // Do submit $.post( this.options.endpoint,