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
This commit is contained in:
Nathan Gray 2014-11-25 00:45:14 +00:00
parent f8b09fa7e8
commit b967548cb5
4 changed files with 33 additions and 40 deletions

View File

@ -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.

View File

@ -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'));
}
});

View File

@ -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;
}

View File

@ -2,7 +2,7 @@
<!-- $Id$ -->
<overlay>
<template id="home.favorite" template="" lang="" group="0" version="1.9.001">
<button id="header_toggle" image="arrow_left" onclick="app.home.nextmatch_toggle_header"/>
<nextmatch id="nm" class="header_hidden"/>
<button id="header_toggle" background_image="true" image="egw_action/arrows" class="closed" onclick="app.home.nextmatch_toggle_header"/>
<nextmatch id="nm" class="header_hidden" hide_header="true"/>
</template>
</overlay>