From b967548cb540df79580451245eefaa40332e1f5c Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 25 Nov 2014 00:45:14 +0000 Subject: [PATCH] More Home progress: - Favorite now hides whole header - Link thumbnail now just setting width to avoid distortion - File thumbnail no longer limited, using full size thumbnail from site configuration or widget width, whichever is smaller - Fix links were using edit instead of view --- etemplate/js/et2_widget_portlet.js | 2 +- home/js/app.js | 16 +++------ home/templates/default/app.css | 51 ++++++++++++++--------------- home/templates/default/favorite.xet | 4 +-- 4 files changed, 33 insertions(+), 40 deletions(-) diff --git a/etemplate/js/et2_widget_portlet.js b/etemplate/js/et2_widget_portlet.js index 3f609782b3..a6155a3abc 100644 --- a/etemplate/js/et2_widget_portlet.js +++ b/etemplate/js/et2_widget_portlet.js @@ -75,7 +75,7 @@ var et2_portlet = et2_valueWidget.extend( }, createNamespace: true, - GRID: 105, + GRID: 50, /** * These are the "normal" actions that every portlet is expected to have. diff --git a/home/js/app.js b/home/js/app.js index 2a8557831a..7f5794ec9b 100644 --- a/home/js/app.js +++ b/home/js/app.js @@ -37,13 +37,13 @@ app.classes.home = AppJS.extend( /** * Grid resolution. Must match et2_portlet GRID */ - GRID: 100, + GRID: 50, /** * Default size for new portlets */ DEFAULT: { - WIDTH: 2, + WIDTH: 4, HEIGHT: 1 }, @@ -295,7 +295,7 @@ app.classes.home = AppJS.extend( egw().log("warning", "Could not find widget"); return; } - egw().open(widget.options.settings.entry, "", 'edit'); + egw().open(widget.options.settings.entry, "", 'view',null,widget.options.settings.entry.app); }, /** @@ -559,7 +559,7 @@ app.classes.home = AppJS.extend( * @param {et2_button} widget */ nextmatch_toggle_header: function(event, widget) { - widget.set_image(widget.options.image == 'arrow_down' ? 'arrow_left' : 'arrow_down'); + widget.set_class(widget.class == 'opened' ? 'closed' : 'opened'); // We operate on the DOM here, nm should be unaware of our fiddling var nm = widget.getParent().getWidgetById('nm'); if(!nm) return; @@ -568,12 +568,6 @@ app.classes.home = AppJS.extend( // Hide header nm.div.toggleClass('header_hidden'); - - header_height -= header.div.height(); - - // Grow row space - I have no idea why it needs to be 25 pixels instead of header_height - var scroll_height = $j('.egwGridView_scrollarea',nm.getDOMNode()).height(); - $j('.egwGridView_scrollarea',nm.getDOMNode()).height(scroll_height + (header_height > 0 ? 25 : -25)); - nm.resize(); + nm.set_hide_header(nm.div.hasClass('header_hidden')); } }); diff --git a/home/templates/default/app.css b/home/templates/default/app.css index 8a83e7be2a..bd78a2b627 100644 --- a/home/templates/default/app.css +++ b/home/templates/default/app.css @@ -84,36 +84,35 @@ float: left; margin-right: 8px; margin-bottom: 8px; - width: 32px; - height: 32px; + max-width: 100%; +} +.et2_portlet.home_link_portlet > div:last-of-type img:first-of-type:not([src*="thumbnail.php"]) { + max-width: 32px; } -/* Favorite / nextmatch */ +/* Favorite / nextmatch + * NB: No favorite sub-class added here, as they have an app-specific prefix + */ .et2_portlet .et2_container > div > .et2_button { - float: left; - margin-bottom: -16px; - min-height: 16px; - min-width: 16px; -} -.et2_portlet .et2_nextmatch.header_hidden .nextmatch_header { - min-height: 6px; -} -.et2_portlet .et2_nextmatch.header_hidden .nextmatch_header .ui-helper-reset{ - height: 0px; - padding: 0px; -} -.et2_portlet .et2_nextmatch.header_hidden .nextmatch_header div.nextmatch_header_row .header_count { - top: -11px; - height: 14px; -} -.et2_portlet .et2_nextmatch.header_hidden .nextmatch_header div.nextmatch_header_row .header_count span { + position:absolute; top: 0px; + left: 100%; + margin-left: -16px; + margin-bottom: -16px; + padding: 0px !important; + height: 12px; + width: 12px; + z-index: 50; } -.et2_portlet .et2_nextmatch.header_hidden .nextmatch_header div.nextmatch_header_row div.search, -.et2_portlet .et2_nextmatch.header_hidden .nextmatch_header div.nextmatch_header_row label, -.et2_portlet .et2_nextmatch.header_hidden .nextmatch_header div.nextmatch_header_row select { - display:none; +.et2_portlet .et2_container > div > button.et2_button_with_image.closed { + background-position: 0 0 !important; } -.et2_portlet .et2_nextmatch.header_hidden .egwGridView_outer:first-of-type { - position: absolute; +.et2_portlet .et2_container > div > button.et2_button_with_image.opened { + background-position: -10px 0 !important; +} +.et2_portlet .et2_nextmatch.header_hidden { + padding-top: 16px; +} +.et2_portlet .et2_nextmatch.header_hidden .egwGridView_outer thead:first-of-type { + display: none; } \ No newline at end of file diff --git a/home/templates/default/favorite.xet b/home/templates/default/favorite.xet index 4db206f1f2..0bc2506f85 100644 --- a/home/templates/default/favorite.xet +++ b/home/templates/default/favorite.xet @@ -2,7 +2,7 @@