Get nextmatch header down to one line, hopefully looking a little nicer

This commit is contained in:
Nathan Gray 2011-10-12 19:06:52 +00:00
parent 5cab1f7811
commit 5b26a5faed
2 changed files with 40 additions and 27 deletions

View File

@ -726,9 +726,8 @@ var et2_nextmatch_header_bar = Class.extend(et2_INextmatchHeader, {
// Left
// Record count
this.count = jQuery(document.createElement("div"))
.addClass("header_count")
.appendTo(this.div);
this.count = jQuery(document.createElement("span"))
.addClass("header_count ui-corner-all");
// Need to figure out how to update this as grid scrolls
//this.count.append("? - ? ").append(egw.lang("of")).append(" ");
@ -743,7 +742,8 @@ var et2_nextmatch_header_bar = Class.extend(et2_INextmatchHeader, {
// Right
this.filters = jQuery(document.createElement("div")).appendTo(this.div);
this.filters = jQuery(document.createElement("div")).appendTo(this.div)
.addClass("filters");
// Add category
@ -762,21 +762,7 @@ var et2_nextmatch_header_bar = Class.extend(et2_INextmatchHeader, {
this.filter2 = this._build_select('filter2', 'select', settings.filter2, settings.filter2_no_lang);
}
// Search
this.search = et2_createWidget("textbox", {"blur":egw.lang("search")}, this.nextmatch);
this.search.input.attr("type", "search")
.css("left", "40%").css("position", "relative");
this.search.input.val(settings.search);
jQuery(document.createElement("button"))
.appendTo(this.filters)
.css("left", "40%").css("position", "relative")
.text(">")
.click(this.nextmatch, function(event) {
event.data.activeFilters.search = self.search.getValue()
event.data.applyFilters();
});
// Export
if(!settings.no_csv_export)
{
@ -796,6 +782,23 @@ var et2_nextmatch_header_bar = Class.extend(et2_INextmatchHeader, {
});
}
this.count.appendTo(this.filters);
// Search
this.search = et2_createWidget("textbox", {"blur":egw.lang("search")}, this.nextmatch);
this.search.input.attr("type", "search");
this.search.input.val(settings.search);
jQuery(document.createElement("button"))
.appendTo(this.filters)
.text(">")
.click(this.nextmatch, function(event) {
event.data.activeFilters.search = self.search.getValue()
event.data.applyFilters();
});
// Letter search
var current_letter = this.nextmatch.options.settings.searchletter ?
this.nextmatch.options.settings.searchletter :
@ -846,14 +849,19 @@ var et2_nextmatch_header_bar = Class.extend(et2_INextmatchHeader, {
"label": this.nextmatch.options.settings[name+"_label"]
},this.nextmatch);
// Set value
select.set_value(value);
// Set options
// Check in content for options-<name>
var mgr = this.nextmatch.getArrayMgr("content");
var options = mgr.getEntry("options-" + name);
// Look in sel_options
if(!options) options = this.nextmatch.getArrayMgr("sel_options").getEntry(name);
// Check parent sel_options, because those are usually global and don't get passed down
if(!options) options = this.nextmatch.getArrayMgr("sel_options").parentMgr.getEntry(name);
if(options) select.set_select_options(options);
// Set value
select.set_value(value);
// Set onChange
var input = select.input;
if(this.nextmatch.options.settings[name+"_onchange"])

View File

@ -511,14 +511,19 @@ label input, label span, label div, label select, label textarea {
/* background-color: silver;*/
}
.nextmatch_header > .header_count {
.nextmatch_header .header_count {
padding: 0px 20px;
margin: 0px 20px;
border: 1px solid #E0E0E0;
float:right;
font-size: 150%;
text-align: center
}
.nextmatch_header .et2_button_icon {
vertical-align: middle;
.nextmatch_header > .filters {
padding: 5px;
}
.nextmatch_header select {
position: relative;
.nextmatch_header .et2_button_icon {
vertical-align: middle;
}
.nextmatch_sortheader {
color: #003075;