Author: hnategh
New Revision: 55190
URL: http://svn.stylite.de/viewvc/egroupware?rev=55190&view=rev
Log:
Add ‘fix’ option for searchbox widget:
- Make possibility for none flex searchbox, simple as just an input field, default value is true.
Modified:
trunk/etemplate/js/et2_extension_nextmatch.js
trunk/etemplate/js/et2_widget_textbox.js
— trunk/etemplate/js/et2_extension_nextmatch.js (original)
+++ trunk/etemplate/js/et2_extension_nextmatch.js Mon Feb 29 14:53:18 2016
@@ -2296,7 +2296,8 @@
onchange:function(){
self.nextmatch.applyFilters({search: this.get_value()});
},
— trunk/etemplate/js/et2_widget_textbox.js (original)
+++ trunk/etemplate/js/et2_widget_textbox.js Mon Feb 29 14:53:18 2016
@@ -423,6 +423,12 @@
type:“boolean”,
default:false,
description:“Define wheter the searchbox overlays while it’s open (true) or stay as solid box infront of the search button (false). Default is false.”
@@ -448,13 +454,16 @@
var self = this;
if (this.options.overlay) this.flex.addClass(‘overlay’);
// search button indicator
-
this.button = et2_createWidget('button',{image:"search","background_image":"1"},this);
-
this.button.onclick= function(){
-
self._show_hide(jQuery(self.flex).hasClass('hide'));
-
self.search.input.focus();
-
};
-
this.div.prepend(this.button.getDOMNode());
-
-
// no need to create search button if it's a fix search field
-
if (!this.options.fix)
-
{
-
this.button = et2_createWidget('button',{image:"search","background_image":"1"},this);
-
this.button.onclick= function(){
-
self._show_hide(jQuery(self.flex).hasClass('hide'));
-
self.search.input.focus();
-
};
-
this.div.prepend(this.button.getDOMNode());
-
}
// input field
this.search = et2_createWidget('textbox',{"blur":egw.lang("search"),
onkeypress:function(event) {
@@ -474,6 +483,7 @@
this.search.input.on({
keyup:function(event)
{
@@ -499,6 +509,7 @@
// clear button implementation
this.clear = jQuery(document.createElement(‘span’))
.addClass(‘ui-icon clear’)
@@ -513,6 +524,7 @@
{
self._show_hide(false);
}
-
if (self.options.fix) self.clear.hide();
})
.appendTo(this.flex);
},
@@ -523,15 +535,21 @@
*/
_show_hide: function(_stat)
{
-
// Not applied for fix option
-
if (this.options.fix) return;
-
jQuery(this.flex).toggleClass('hide',!_stat);
jQuery(this.getDOMNode()).toggleClass('expanded', _stat);
},
- /**
- toggle search button status based on value
*/
_searchToggleState:function()
{
-
// Not applied for fix option
-
if (this.options.fix) return;
-
if (!this.get_value())
{
jQuery(this.button.getDOMNode()).removeClass('toolbar_toggled');
@@ -577,6 +595,18 @@
this._show_hide(!this.options.overlay);
this._searchToggleState();
}
- },
-
- /**
-
- Overrride attachToDOM in order to unbind change handler
- */
- attachToDOM: function() {
-
this._super.apply(this,arguments);
-
var node = this.getInputNode();
-
if (node)
-
{
-
$j(node).off('.et2_inputWidget');
-
}
- },
});
et2_register_widget(et2_searchbox, [“searchbox”]);
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs