From 4759d19d25ead64077c7af57e42fd677f34d80d8 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 24 Apr 2013 19:53:51 +0000 Subject: [PATCH] Fix nextmatch hierarchy display --- etemplate/js/et2_dataview_controller.js | 13 ++++++- etemplate/js/et2_dataview_view_row.js | 15 ++++---- etemplate/templates/default/etemplate2.css | 44 +++++++++++++++++++--- 3 files changed, 59 insertions(+), 13 deletions(-) diff --git a/etemplate/js/et2_dataview_controller.js b/etemplate/js/et2_dataview_controller.js index a3f44f6e09..d6c630f34f 100644 --- a/etemplate/js/et2_dataview_controller.js +++ b/etemplate/js/et2_dataview_controller.js @@ -498,7 +498,18 @@ var et2_dataview_controller = Class.extend({ var d = this.self.getDepth(); if (d > 0) { - $j(tr).addClass("subentry level_" + d); + $j(tr).addClass("subentry"); + $j("td:first",tr).children("div").last().addClass("level_" + d + " indentation"); + + if(this.entry.idx == 0) + { + // Set the CSS for the level - required so columns line up + var indent = $j("").appendTo(tr); + egw.css(".subentry td div.innerContainer.level_"+d, + "margin-right:" + (parseInt(indent.css("margin-right")) * d) + "px" + ); + indent.remove(); + } } var links = null; diff --git a/etemplate/js/et2_dataview_view_row.js b/etemplate/js/et2_dataview_view_row.js index d885e44327..0f589c971e 100644 --- a/etemplate/js/et2_dataview_view_row.js +++ b/etemplate/js/et2_dataview_view_row.js @@ -69,14 +69,15 @@ var et2_dataview_row = et2_dataview_container.extend(et2_dataview_IViewRange, { this.expansionButton = $j(document.createElement("span")); this.expansionButton.addClass("arrow closed"); - - var self = this; - this.expansionButton.click(function () { - self._handleExpansionButtonClick(_callback, _context); - }); - - $j("td:first", this.tr).prepend(this.expansionButton); } + + // Update context + var self = this; + this.expansionButton.off("click").on("click", function () { + self._handleExpansionButtonClick(_callback, _context); + }); + + $j("td:first", this.tr).prepend(this.expansionButton); } else { diff --git a/etemplate/templates/default/etemplate2.css b/etemplate/templates/default/etemplate2.css index 8f7fb06698..b8472f89c6 100644 --- a/etemplate/templates/default/etemplate2.css +++ b/etemplate/templates/default/etemplate2.css @@ -772,8 +772,7 @@ label input, label span, label div, label select, label textarea { .nextmatch_header .header_count { padding: 0px 20px; - margin: 0px 20px; - margin-top: 5px; + margin: 5px 20px 0px; border: 1px solid #E0E0E0; float:right; font-size: 150%; @@ -807,20 +806,28 @@ label input, label span, label div, label select, label textarea { } /* Favorites */ .nextmatch_header div#favorite_wrapper { - margin-top: 5px; + margin-top: 8px; vertical-align: middle; } #nm_favorites_popup_filters .filter_id, #nm_favorites_popup_filters .filter_value { width: 45%; display: inline-block; } -.favorites li a { +.nextmatch_header ul.favorites { + min-width: 20ex; +} +.nextmatch_header .favorites li a { + text-indent: -22px; + margin-left: 21px; +} +.nextmatch_header .favorites.ui-menu li.ui-menu-item a.ui-state-hover { + margin-left: 20px; } .favorites li span.ui-state-active { border: none; } .favorites input, .favorites img { - margin-right: 2ex; + margin-right: 1ex; } .favorites div.ui-icon-trash { float:right; @@ -889,6 +896,33 @@ label input, label span, label div, label select, label textarea { opacity: 0.5; } +/** + * Grid / nextmatch Hierarchy + */ +/* Make sure arrow & cell content don't overlap */ +.egwGridView_grid span.arrow { + margin: 6px -12px 4px 4px; + float: left; + position:relative; +} +.egwGridView_grid span.arrow ~ div.innerContainer { + display: inline-block; +} +/* Indent the sub-grid */ +.egwGridView_grid .egwGridView_grid { + margin-left: 10px; + border-left: 1px solid silver; +} +/** + * This class' margin-right is used to line up columns at each indent level + * Classes level_# are created programmatically with margin-right * depth + * Margin-right = -(indent + border) + */ +.indentation { margin-right:-11px; } + +/* End of hierarchy */ + + .et2_clickable { cursor: pointer; }