add toggleIconSize to documents view
This commit is contained in:
parent
05dcc997b6
commit
20e43ff0c7
1 changed files with 31 additions and 1 deletions
|
@ -133,7 +133,7 @@ pandora.ui.documentInfoView = function(data, isMixed) {
|
|||
height: iconHeight + 'px'
|
||||
})
|
||||
.bindEvent({
|
||||
// singleclick: toggleIconSize
|
||||
singleclick: toggleIconSize
|
||||
})
|
||||
.appendTo($info),
|
||||
|
||||
|
@ -636,6 +636,36 @@ pandora.ui.documentInfoView = function(data, isMixed) {
|
|||
//renderCapabilities(data.rightslevel);
|
||||
}
|
||||
|
||||
function toggleIconSize() {
|
||||
iconSize = iconSize == 256 ? 512 : 256;
|
||||
iconWidth = iconRatio > 1 ? iconSize : Math.round(iconSize * iconRatio);
|
||||
iconHeight = iconRatio < 1 ? iconSize : Math.round(iconSize / iconRatio);
|
||||
iconLeft = iconSize == 256 ? Math.floor((iconSize - iconWidth) / 2) : 0,
|
||||
$icon.animate({
|
||||
left: margin + iconLeft + 'px',
|
||||
width: iconWidth + 'px',
|
||||
height: iconHeight + 'px',
|
||||
}, 250);
|
||||
$reflection.animate({
|
||||
top: margin + iconHeight + 'px',
|
||||
width: iconSize + 'px',
|
||||
height: iconSize / 2 + 'px'
|
||||
}, 250);
|
||||
$reflectionIcon.animate({
|
||||
left: iconLeft + 'px',
|
||||
width: iconWidth + 'px',
|
||||
height: iconHeight + 'px',
|
||||
}, 250);
|
||||
$reflectionGradient.animate({
|
||||
width: iconSize + 'px',
|
||||
height: iconSize / 2 + 'px'
|
||||
}, 250);
|
||||
$text.animate({
|
||||
left: margin + (iconSize == 256 ? 256 : iconWidth) + margin + 'px'
|
||||
}, 250);
|
||||
pandora.UI.set({infoIconSize: iconSize});
|
||||
}
|
||||
|
||||
that.reload = function() {
|
||||
/*
|
||||
var src = '/documents/' + data.id + '/512p.jpg?' + data.modified;
|
||||
|
|
Loading…
Reference in a new issue