Author: hnategh
New Revision: 55011
URL: http://svn.stylite.de/viewvc/egroupware?rev=55011&view=rev
Log:
Implement nextmatch search using searchbox widget
Modified:
trunk/etemplate/js/et2_extension_nextmatch.js
— trunk/etemplate/js/et2_extension_nextmatch.js (original)
+++ trunk/etemplate/js/et2_extension_nextmatch.js Mon Feb 15 19:37:24 2016
@@ -2280,54 +2280,20 @@
this.header_div = this.row_div = jQuery(document.createElement(“div”))
.addClass(“nextmatch_header_row”)
.appendTo(this.div);
-
.prependTo(egwIsMobile()?this.nextmatch.div:this.row_div)
-
.addClass("search");
-
this.search = et2_createWidget("textbox", {"id":"search","blur":egw.lang("search")}, this);
-
this.search.input.attr("type", "search");
-
this.search.input.val(settings.search)
-
.on("keypress", function(event) {
-
if(event.which == 13)
-
{
-
event.preventDefault();
-
self.getInstanceManager().autocomplete_fixer();
-
// Use a timeout to make sure we get the autocomplete value,
-
// if one was chosen, instead of what was actually typed.
-
// Chrome doesn't need this, but FF does.
-
window.setTimeout(function() {
-
self.nextmatch.applyFilters({search: self.search.getValue()});
-
},0);
-
}
-
});
-
// Firefox treats search differently. Add in the clear button.
-
if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1)
-
{
-
this.search.input.on("keyup",
-
function(event) {
-
// Insert the button, if needed
-
if(self.search.input.next('span').length == 0)
-
{
-
self.search.input.after(
-
$j('<span class="ui-icon"></span>').click(
-
function() {self.search.input.val('');self.search.input.focus();}
-
)
-
);
-
}
-
if(event.which == 27) // Escape
-
{
-
// Excape clears search
-
self.search.input.val('');
-
}
-
self.search.input.next('span').toggle(self.search.input.val() != '');
-
}
-
);
-
}
-
-
.prependTo(egwIsMobile()?this.nextmatch.div:this.row_div);
-
// searchbox widget
-
this.et2_searchbox = et2_createWidget('searchbox', {id:"search",onchange:function(){
-
self.nextmatch.applyFilters({search: this.get_value()});
-
}
-
},this);
-
// Set activeFilters to current value
this.nextmatch.activeFilters.search = settings.search;
@@ -2367,18 +2333,12 @@
.prependTo(this.search_box);
-
this.search_button = et2_createWidget("button", {id: "search_button","background":"pixelegg/images/topmenu_items/mobile/search_white.png"}, this);
-
this.search_button = et2_createWidget("button", {id: "search_button"}, this);
this.search.input.on ('focus blur', function (e){
self.search_box.toggleClass('searchOn');
});
}
-
else
-
{
-
this.search_button = et2_createWidget("button", {id: "search_button","label":">"}, this);
-
this.search_button.onclick = function(event) {
-
self.nextmatch.applyFilters({search: self.search.getValue()});
-
};
-
}
// Add category
if(!settings.no_cat) {
@@ -2772,7 +2732,7 @@
return this.row_div[0];
}
}
@@ -3397,7 +3357,6 @@
}
var self = this;
// Fire on lost focus, clear filter if user emptied box
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