some bit shuffling that seems to make item views return to lists views with proper selection

This commit is contained in:
rolux 2011-08-17 09:29:42 +00:00
parent b9fb78d395
commit 3b00b384f2
8 changed files with 28 additions and 19 deletions

View file

@ -504,7 +504,7 @@
"icons": "posters",
"infoIconSize": 256,
"item": "",
"itemView": "timeline",
"itemView": "info",
"list": "",
"listQuery": {"conditions": [], "operator": ""},
"lists": {

View file

@ -162,8 +162,6 @@ Ox.load('Geo', function() {
height: pandora.$ui.contentPanel.size(1),
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
});
//pandora.user.ui.itemView == 'frames' && pandora.$ui.item.resize();
//pandora.user.ui.itemView == 'posters' && pandora.$ui.item.resize();
}
}

View file

@ -104,9 +104,11 @@ pandora.URL = (function() {
} else if (pandora.user.ui.sitePage != oldUserUI.sitePage) {
pandora.$ui.mainPanel.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());
} else if (!pandora.user.ui.item || !oldUserUI.item) {
// list to list, list to item, item to list
pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info());
pandora.$ui.mainPanel.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());
} else {
// item to items
pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info());
pandora.$ui.contentPanel.replaceElement(1, pandora.ui.item());
}
@ -115,11 +117,12 @@ pandora.URL = (function() {
oldUserUI.item &&
['player', 'timeline'].indexOf(oldUserUI.itemView) > -1
) {
pandora.UI.set(
'videoPosition|' + oldUserUI.item,
pandora.$ui[
var $item = pandora.$ui[
oldUserUI.itemView == 'player' ? 'player' : 'editor'
].options('position')
];
$item && pandora.UI.set(
'videoPosition|' + oldUserUI.item,
$item.options('position')
);
}
}

View file

@ -56,7 +56,6 @@ pandora.ui.browser = function() {
};
},
items: function(data, callback) {
//Ox.print('data, pandora.Query.toObject', data, pandora.Query.toObject())
pandora.api.find($.extend(data, {
query: pandora.Query.toObject()
}), callback);
@ -75,6 +74,7 @@ pandora.ui.browser = function() {
that.scrollToSelection();
},
select: function(event, data) {
pandora.UI.set('lists|' + pandora.user.ui.list + '|selected', data.ids);
pandora.URL.set(data.ids[0]);
},
toggle: function(event, data) {

View file

@ -11,7 +11,7 @@ pandora.ui.contentPanel = function() {
size: pandora.user.ui.groupsSize
},
{
element: pandora.$ui.list = pandora.ui.list(pandora.user.ui.lists[pandora.user.ui.list].listView)
element: pandora.$ui.list = pandora.ui.list()
}
] : [
{
@ -21,7 +21,7 @@ pandora.ui.contentPanel = function() {
size: 112 + Ox.UI.SCROLLBAR_SIZE
},
{
element: pandora.$ui.item = pandora.ui.item(pandora.user.ui.item, pandora.user.ui.itemView)
element: pandora.$ui.item = pandora.ui.item()
}
],
orientation: 'vertical'

View file

@ -14,6 +14,7 @@ pandora.ui.infoView = function(data) {
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,
borderRadius = pandora.user.ui.icons == 'posters' ? 0 : iconSize / 8,
edit = false,
that = Ox.Element(),
uid = Ox.uid(),
@ -47,6 +48,7 @@ pandora.ui.infoView = function(data) {
top: margin + 'px',
width: iconWidth + 'px',
height: iconHeight + 'px',
borderRadius: borderRadius + 'px',
cursor: 'pointer'
})
.bindEvent({
@ -74,7 +76,8 @@ pandora.ui.infoView = function(data) {
position: 'absolute',
left: iconLeft + 'px',
width: iconWidth + 'px',
height: iconHeight + 'px'
height: iconHeight + 'px',
borderRadius: borderRadius + 'px'
})
.appendTo($reflection),
$reflectionGradient = $('<div>')
@ -462,10 +465,12 @@ pandora.ui.infoView = function(data) {
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,
borderRadius = pandora.user.ui.icons == 'posters' ? 0 : iconSize / 8;
$icon.animate({
left: margin + iconLeft + 'px',
width: iconWidth + 'px',
height: iconHeight + 'px'
height: iconHeight + 'px',
borderRadius: borderRadius + 'px'
}, 250);
$reflection.animate({
top: margin + iconHeight + 'px',
@ -476,6 +481,7 @@ pandora.ui.infoView = function(data) {
left: iconLeft + 'px',
width: iconWidth + 'px',
height: iconHeight + 'px',
borderRadius: borderRadius + 'px'
}, 250);
$reflectionGradient.animate({
width: iconSize + 'px',
@ -495,7 +501,7 @@ pandora.ui.infoView = function(data) {
$reflectionIcon.attr({src: src});
iconSize = iconSize == 256 ? 512 : 256;
iconRatio = pandora.user.ui.icons == 'posters'
? data.poster.width / data.poster.height : 1,
? data.poster.width / data.poster.height : 1;
toggleIconSize();
pandora.user.level == 'admin' && $list.replaceWith($list = renderList());
};

View file

@ -1,8 +1,9 @@
// vim: et:ts=4:sw=4:sts=4:ft=javascript
pandora.ui.list = function(view) { // fixme: remove view argument
pandora.ui.list = function() { // fixme: remove view argument
var that, $map,
preview = false;
view = pandora.user.ui.lists[pandora.user.ui.list].listView,
preview = false
//Ox.print('constructList', view);
if (view == 'list') {
/*
@ -72,6 +73,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
}
});
} else if (view == 'icons') {
//alert(JSON.stringify(pandora.user.ui.lists[pandora.user.ui.list].selected))
that = Ox.IconList({
defaultRatio: pandora.user.ui.icons == 'posters' ? 5/8 : 1,
id: 'list',
@ -97,6 +99,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
}), callback);
},
keys: ['director', 'id', 'poster', 'title', 'year'],
selected: pandora.user.ui.lists[pandora.user.ui.list].selected,
size: 128,
sort: pandora.user.ui.lists[pandora.user.ui.list].sort,
unique: 'id'
@ -410,7 +413,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
},
select: function(event, data) {
var $still, $timeline;
pandora.user.selectedMovies = data.ids;
pandora.user.ui.lists[pandora.user.ui.list].selected = data.ids;
if (data.ids.length) {
pandora.$ui.mainMenu.enableItem('copy');
pandora.$ui.mainMenu.enableItem('openmovie');

View file

@ -1,4 +1,5 @@
// vim: et:ts=4:sw=4:sts=4:ft=javascript
pandora.ui.rightPanel = function() {
var that;
if (pandora.user.ui.section == 'site') {
@ -10,8 +11,7 @@ pandora.ui.rightPanel = function() {
}
});
} else {
that = Ox.Element()
.css({padding: '8px'});
that = Ox.Element().css({padding: '8px'});
pandora.api.getPage(pandora.user.ui.sitePage, function(result) {
that.html(result.data.body).css({overflowY: 'auto'});
});
@ -36,7 +36,6 @@ pandora.ui.rightPanel = function() {
})
.bindEvent({
resize: function(event, data) {
//Ox.print('???? resize rightPanel', event, data)
if (!pandora.user.ui.item) {
pandora.resizeGroups(data);
pandora.$ui.list.size();