From 5b26a5faedabf226b5673d1ccd49202978f47c31 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 12 Oct 2011 19:06:52 +0000 Subject: [PATCH] Get nextmatch header down to one line, hopefully looking a little nicer --- etemplate/js/et2_extension_nextmatch.js | 52 ++++++++++++++----------- etemplate/js/test/test.css | 15 ++++--- 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index 81580a1ea0..718bea6e48 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -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- 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"]) diff --git a/etemplate/js/test/test.css b/etemplate/js/test/test.css index 73b5f54d76..65a9738b44 100644 --- a/etemplate/js/test/test.css +++ b/etemplate/js/test/test.css @@ -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;