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

View File

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

View File

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

View File

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