From db1244dc505f9e2658c8a0117fa5b7d2fe17d140 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 12 Mar 2014 09:47:40 +0000 Subject: [PATCH] put favorites, counter and new header_row into one container (header_row_right) to float them all to the right, also removed lots of unnecessary css and fixed alignment --- etemplate/js/et2_extension_nextmatch.js | 12 +++---- etemplate/js/etemplate2.js | 2 +- etemplate/templates/default/etemplate2.css | 37 +++++++--------------- 3 files changed, 18 insertions(+), 33 deletions(-) diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index 8acd2c9e28..714ea40320 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -1806,8 +1806,8 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, } // Other stuff - this.icons_div = jQuery(document.createElement("div")) - .addClass('icons').appendTo(this.row_div); + this.right_div = jQuery(document.createElement("div")) + .addClass('header_row_right').appendTo(this.row_div); // Record count this.count = jQuery(document.createElement("span")) @@ -1818,7 +1818,7 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, this.count_total = jQuery(document.createElement("span")) .appendTo(this.count) .text(settings.total + ""); - this.count.prependTo(this.icons_div); + this.count.prependTo(this.right_div); // Favorites this._setup_favorites(settings['favorites']); @@ -1852,7 +1852,7 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, // Another place to customize nextmatch this.header_row = jQuery(document.createElement("div")) - .addClass('header_row').appendTo(this.row_div); + .addClass('header_row').appendTo(this.right_div); // Letter search var current_letter = this.nextmatch.options.settings.searchletter ? @@ -2058,7 +2058,7 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, this.favorites = et2_createWidget('favorites', widget_options, this); // Add into header - $j(this.favorites.getDOMNode(this.favorites)).appendTo(this.icons_div).css("float","right"); + $j(this.favorites.getDOMNode(this.favorites)).prependTo(this.right_div); }, /** @@ -2167,7 +2167,7 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, } } if(_sender == this.search || _sender == this.search_button) return this.search_box[0]; - if(_sender.id == 'export') return this.icons_div[0]; + if(_sender.id == 'export') return this.right_div[0]; if(_sender && _sender._type == "template") { diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js index 8f3a4ec32a..6f94f7bbf2 100644 --- a/etemplate/js/etemplate2.js +++ b/etemplate/js/etemplate2.js @@ -805,7 +805,7 @@ etemplate2.getById = function(id) } } return null; -} +}; /** * Plugin for egw.json type "et2_load" diff --git a/etemplate/templates/default/etemplate2.css b/etemplate/templates/default/etemplate2.css index 02bfb0fac9..5172136cf0 100644 --- a/etemplate/templates/default/etemplate2.css +++ b/etemplate/templates/default/etemplate2.css @@ -819,42 +819,29 @@ div.message.floating { } .nextmatch_header .header_count { padding: 0px 20px; - margin: 6px 6px 0px; + margin: 0px 6px 0px; border: 1px solid #E0E0E0; - float: right; font-size: 150%; text-align: center; } -.nextmatch_header > .search { - float: left; - width: 16%; - position: relative; - z-index: 1; +.nextmatch_header .search { + padding-left: 1ex; } -.nextmatch_header > .search > input { - width: 75%; +.nextmatch_header_row select { + max-width: 14%; + margin-right: 2ex; } -.nextmatch_header > .filters { - padding-left: 5px; - position: relative; - top: 7px; - white-space: nowrap; +.nextmatch_header_row > .header_row_right { + float: right; + padding-right: 1ex; } -.nextmatch_header > .filters select { - width: 14%; - margin-right: 2ex; -} -.nextmatch_header .et2_button_icon { - vertical-align: middle; -} -.nextmatch_header > .filters .et2_button_icon { - margin-right: 1ex; +.nextmatch_header_row > .header_row_right > * { + display: inline-block; } .et2_nextmatch .nextmatch_header { border: none; background-image: none; background-color: transparent; - margin-bottom: 3px; } .et2_nextmatch .nextmatch_header_row > div { display: inline-block; @@ -862,9 +849,7 @@ div.message.floating { /* Favorites */ .nextmatch_header div[id$=favorite_wrapper] { margin-top: 6px; - vertical-align: middle; position: relative; - z-index: 1; } #nm_favorites_popup_filters .filter_id, #nm_favorites_popup_filters .filter_value {