diff --git a/static/js/infoView.amp.js b/static/js/infoView.amp.js index dc8d03b..c71eab2 100644 --- a/static/js/infoView.amp.js +++ b/static/js/infoView.amp.js @@ -1,10 +1,12 @@ 'use strict'; -pandora.ui.infoView = function(data) { +pandora.ui.infoView = function(data, isMixed) { + isMixed = isMixed || {}; var ui = pandora.user.ui, - canEdit = pandora.site.capabilities.canEditMetadata[pandora.user.level] || data.editable, - canRemove = pandora.site.capabilities.canRemoveItems[pandora.user.level] || data.editable, + isMultiple = arguments.length == 2, + canEdit = pandora.hasCapability('canEditMetadata') || isMultiple || data.editable, + canRemove = pandora.hasCapability('canRemoveItems'), css = { marginTop: '4px', textAlign: 'justify' @@ -12,10 +14,10 @@ pandora.ui.infoView = function(data) { descriptions = [], html, iconRatio = ui.icons == 'posters' ? data.posterRatio : 1, - iconSize = ui.infoIconSize, - iconWidth = iconRatio > 1 ? iconSize : Math.round(iconSize * iconRatio), + iconSize = isMultiple ? 0 : ui.infoIconSize, + iconWidth = isMultiple ? 0 : iconRatio > 1 ? iconSize : Math.round(iconSize * iconRatio), iconHeight = iconRatio < 1 ? iconSize : Math.round(iconSize / iconRatio), - iconLeft = iconSize == 256 ? Math.floor((iconSize - iconWidth) / 2) : 0, + iconLeft = isMultiple ? 0 : iconSize == 256 ? Math.floor((iconSize - iconWidth) / 2) : 0, borderRadius = ui.icons == 'posters' ? 0 : iconSize / 8, margin = 16, nameKeys = pandora.site.itemKeys.filter(function(key) { @@ -61,7 +63,9 @@ pandora.ui.infoView = function(data) { .bindEvent({ click: function(data_) { if (data_.id == 'delete') { - pandora.$ui.deleteItemDialog = pandora.ui.deleteItemDialog(data).open(); + pandora.$ui.deleteItemsDialog = pandora.ui.deleteItemsDialog({ + items: [data] + }).open(); } } }) @@ -96,7 +100,7 @@ pandora.ui.infoView = function(data) { that = Ox.SplitPanel({ elements: [ - {element: $bar, size: 16}, + {element: $bar, size: isMultiple ? 0 : 16}, {element: $info} ], orientation: 'vertical' @@ -106,66 +110,68 @@ pandora.ui.infoView = function(data) { .css({ position: 'absolute' }) - .appendTo($info), + .appendTo($info); - $icon = Ox.Element({ - element: '' - }) - .attr({ - src: pandora.getMediaURL('/' + data.id + '/' + ( - ui.icons == 'posters' ? 'poster' : 'icon' - ) + '512.jpg?' + data.modified) - }) - .css({ - position: 'absolute', - left: margin + iconLeft + 'px', - top: margin + 'px', - width: iconWidth + 'px', - height: iconHeight + 'px', - borderRadius: borderRadius + 'px', - cursor: 'pointer' - }) - .bindEvent({ - singleclick: toggleIconSize - }) - .appendTo($left), + if (!isMultiple) { + var $icon = Ox.Element({ + element: '' + }) + .attr({ + src: pandora.getMediaURL('/' + data.id + '/' + ( + ui.icons == 'posters' ? 'poster' : 'icon' + ) + '512.jpg?' + data.modified) + }) + .css({ + position: 'absolute', + left: margin + iconLeft + 'px', + top: margin + 'px', + width: iconWidth + 'px', + height: iconHeight + 'px', + borderRadius: borderRadius + 'px', + cursor: 'pointer' + }) + .bindEvent({ + singleclick: toggleIconSize + }) + .appendTo($left), - $reflection = $('