mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Advanced search: WIP POC, UI/UX.
SVN:b1162[5440]
This commit is contained in:
@@ -172,10 +172,11 @@ $(function()
|
||||
// - Open it first
|
||||
this.element.addClass('opened');
|
||||
// - Then only check if more menu is to close to the right side (otherwise we might not have the right element's position)
|
||||
var iPageWidth = $(document).width();
|
||||
var iFormWidth = this.element.find('.sfc_form_group').outerWidth();
|
||||
var iFormLeftPos = this.element.find('.sfc_form_group').offset().left;
|
||||
if( (iFormWidth + iFormLeftPos) > (iPageWidth - 10 /* Security margin */) )
|
||||
var iFormWidth = this.element.closest('.search_form_handler').outerWidth();
|
||||
var iFormLeftPos = this.element.closest('.search_form_handler').offset().left;
|
||||
var iContentWidth = this.element.find('.sfc_form_group').outerWidth();
|
||||
var iContentLeftPos = this.element.find('.sfc_form_group').offset().left;
|
||||
if( (iContentWidth + iContentLeftPos) > (iFormWidth + iFormLeftPos - 10 /* Security margin */) )
|
||||
{
|
||||
this.element.addClass('opened_left');
|
||||
}
|
||||
|
||||
@@ -133,6 +133,10 @@ $(function()
|
||||
this.element.on('submit', function(oEvent){
|
||||
oEvent.preventDefault();
|
||||
});
|
||||
// - Submit the search form
|
||||
this.element.on('itop.search.form.submit', function(oEvent, oData){
|
||||
me._onSubmit();
|
||||
});
|
||||
|
||||
// Criteria events
|
||||
this.element.on('itop.search.criteria.opening', function(oEvent, oData){
|
||||
@@ -180,10 +184,11 @@ $(function()
|
||||
// - Open it first
|
||||
this.elements.more_criterion.addClass('opened');
|
||||
// - Then only check if more menu is to close to the right side (otherwise we might not have the right element's position)
|
||||
var iPageWidth = $(document).width();
|
||||
var iFormWidth = this.element.outerWidth();
|
||||
var iFormLeftPos = this.element.offset().left;
|
||||
var iMenuWidth = this.elements.more_criterion.find('.sfm_content').outerWidth();
|
||||
var iMenuLeftPos = this.elements.more_criterion.find('.sfm_content').offset().left;
|
||||
if( (iMenuWidth + iMenuLeftPos) > (iPageWidth - 10 /* Security margin */) )
|
||||
if( (iMenuWidth + iMenuLeftPos) > (iFormWidth + iFormLeftPos - 10 /* Security margin */) )
|
||||
{
|
||||
this.elements.more_criterion.addClass('opened_left');
|
||||
}
|
||||
@@ -480,6 +485,12 @@ $(function()
|
||||
|
||||
|
||||
// Submit handlers
|
||||
// - External event callback
|
||||
_onSubmit: function()
|
||||
{
|
||||
this._submit();
|
||||
},
|
||||
// - Do the submit
|
||||
_submit: function()
|
||||
{
|
||||
var me = this;
|
||||
|
||||
Reference in New Issue
Block a user