Fix searchbox button occupies so much space

This commit is contained in:
Hadi Nategh 2016-02-16 13:46:16 +00:00
parent e06a8bc167
commit db7e7135ea
4 changed files with 18 additions and 9 deletions

View File

@ -428,7 +428,9 @@ var et2_searchbox = et2_textbox.extend(
this.value = "";
this.div = jQuery(document.createElement('div'))
.addClass('et2_searchbox');
this.flex = jQuery(document.createElement('div'))
.addClass('flex')
.appendTo(this.div);
this._super.apply(this, arguments);
this.setDOMNode(this.div[0]);
this._createWidget();
@ -481,7 +483,7 @@ var et2_searchbox = et2_textbox.extend(
if (event.target.type == 'span') event.stopImmidatePropagation();
}
});
this.div.append(this.search.getDOMNode());
this.flex.append(this.search.getDOMNode());
// clear button implementation
this.clear = jQuery(document.createElement('span'))
@ -501,7 +503,7 @@ var et2_searchbox = et2_textbox.extend(
self._show_hide(false);
}
})
.appendTo(this.div);
.appendTo(this.flex);
},
/**
@ -510,8 +512,7 @@ var et2_searchbox = et2_textbox.extend(
*/
_show_hide: function(_stat)
{
jQuery(this.search.getDOMNode()).toggleClass('hide',!_stat);
jQuery('span.clear',this.div).toggleClass('hide',!_stat);
jQuery(this.flex).toggleClass('hide',!_stat);
jQuery(this.getDOMNode()).toggleClass('expanded', _stat);
},

View File

@ -2231,9 +2231,6 @@ td.avatar {
.et2_searchbox {
position: relative;
padding: 0 0 0 0px;
margin-right: 15px;
margin-left: 15px;
width: 200px;
z-index: 100;
white-space: nowrap;
}
@ -2251,7 +2248,7 @@ td.avatar {
position: absolute;
top: 5px;
height: 18px;
width: 80%;
width: 100%;
}
.et2_searchbox span.ui-icon.clear{
display: inline-block;
@ -2261,6 +2258,11 @@ td.avatar {
right: 5px;
top: 6px;
}
.et2_searchbox .flex {
width:200px;
position: absolute;
display: inline-block;
}
.et2_searchbox .hide {
display: none !important;
}

View File

@ -8207,4 +8207,7 @@ span.egw_tutorial_title {
right: 80px;
top: 14px;
}
body .et2_searchbox.expanded .flex {
width: 100%;
}
}

View File

@ -1796,6 +1796,9 @@
right:80px;
top:14px;
}
.flex{
width:100%;
}
}
}
}