forked from 0x2620/pandora
fix back button css
This commit is contained in:
parent
50a741c9fa
commit
fadbb123bd
2 changed files with 65 additions and 56 deletions
|
@ -5,7 +5,7 @@ pandora.ui.backButton = function() {
|
|||
width: 96
|
||||
}).css({
|
||||
float: 'left',
|
||||
margin: '4px'
|
||||
margin: '4px 0 0 4px'
|
||||
})
|
||||
.bindEvent({
|
||||
click: function() {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
||||
pandora.ui.folders = function() {
|
||||
var that = Ox.Element()
|
||||
var ui = pandora.user.ui,
|
||||
that = Ox.Element()
|
||||
.css({overflowX: 'hidden', overflowY: 'auto'})
|
||||
.bindEvent({
|
||||
resize: pandora.resizeFolders
|
||||
|
@ -14,24 +15,26 @@ pandora.ui.folders = function() {
|
|||
pandora.$ui.findListSelect = {};
|
||||
pandora.$ui.findListInput = {};
|
||||
pandora.$ui.manageListsButton = {};
|
||||
if (pandora.user.ui.section == 'items') {
|
||||
if (ui.section == 'items') {
|
||||
pandora.site.sectionFolders.items.forEach(function(folder, i) {
|
||||
var extras;
|
||||
var extras, $select;
|
||||
if (folder.id == 'personal') {
|
||||
if (pandora.user.level == 'guest') {
|
||||
extras = [infoButton('Personal Lists', 'To create and share your own lists of movies, please sign up or sign in.')];
|
||||
extras = [
|
||||
infoButton('Personal Lists', 'To create and share your own lists of movies, please sign up or sign in.')
|
||||
];
|
||||
} else {
|
||||
extras = [Ox.Select({
|
||||
extras = [
|
||||
pandora.$ui.personalListsSelect = Ox.Select({
|
||||
items: [
|
||||
{ id: 'newlist', title: 'New List...' },
|
||||
{ id: 'newlistfromselection', title: 'New List from Current Selection...', disabled: true },
|
||||
{ id: 'newlist', title: 'New List' },
|
||||
{ id: 'newlistfromselection', title: 'New List from Selection...', disabled: ui.listSelection.length == 0 },
|
||||
{ id: 'newsmartlist', title: 'New Smart List' },
|
||||
{ id: 'newsmartlistfromresults', title: 'New Smart List from Results' },
|
||||
{},
|
||||
{ id: 'newsmartlist', title: 'New Smart List...' },
|
||||
{ id: 'newsmartlistfromresults', title: 'New Smart List from Current Results...', disabled: true },
|
||||
{},
|
||||
{ id: 'duplicate', title: 'Duplicate List' },
|
||||
{ id: 'copyselection', title: 'Copy Selection to List...' },
|
||||
{ id: 'moveselection', title: 'Move Selection to List...' }
|
||||
{ id: 'duplicatelist', title: 'Duplicate Selected List', disabled: !pandora.user.ui._list },
|
||||
{ id: 'editlist', title: 'Edit Selected List...', disabled: !pandora.user.ui._list },
|
||||
{ id: 'deletelist', title: 'Delete Selected List...', disabled: !pandora.user.ui._list }
|
||||
],
|
||||
max: 0,
|
||||
min: 0,
|
||||
|
@ -43,31 +46,37 @@ pandora.ui.folders = function() {
|
|||
click: function(data) {
|
||||
var $list = pandora.$ui.folderList[folder.id];
|
||||
// fixme: duplicated
|
||||
if (data.id == 'new' || data.id == 'newsmart') {
|
||||
pandora.api.addList({
|
||||
name: 'Untitled',
|
||||
status: 'private',
|
||||
type: data.id == 'new' ? 'static' : 'smart'
|
||||
}, function(result) {
|
||||
var id = result.data.id;
|
||||
pandora.UI.set({
|
||||
find: {
|
||||
conditions: [{key: 'list', value: id, operator: '=='}],
|
||||
operator: '&'
|
||||
if ([
|
||||
'newlist', 'newlistfromselection', 'newsmartlist', 'newsmartlistfromresults'
|
||||
].indexOf(data.id) > -1) {
|
||||
pandora.addList(data.id.indexOf('smart') > -1, data.id.indexOf('from') > -1);
|
||||
} else if (data.id == 'duplicatelist') {
|
||||
pandora.addList(pandora.user.ui._list);
|
||||
} else if (data.id == 'editlist') {
|
||||
pandora.ui.listDialog().open();
|
||||
} else if (data.id == 'deletelist') {
|
||||
pandora.ui.deleteListDialog().open();
|
||||
}
|
||||
});
|
||||
Ox.Request.clearCache('"findLists"');
|
||||
$list.reloadList().bindEventOnce({
|
||||
load: function(data) {
|
||||
$list.gainFocus()
|
||||
.options({selected: [id]})
|
||||
.editCell(id, 'name');
|
||||
},
|
||||
pandora_find: function() {
|
||||
/*
|
||||
var action = ui._list
|
||||
&& pandora.getListData(ui._list).user == pandora.user.username
|
||||
? 'enableItem' : 'disableItem';
|
||||
pandora.$ui.personalListsSelect[action]('editlist');
|
||||
pandora.$ui.personalListsSelect[action]('duplicatelist');
|
||||
pandora.$ui.personalListsSelect[action]('deletelist');
|
||||
pandora.$ui.personalListsSelect[ui.listSelection.length ? 'enableItem' : 'disableItem']('newlistfromselection');
|
||||
*/
|
||||
},
|
||||
pandora_listselection: function(data) {
|
||||
/*
|
||||
Ox.print('pandora_listselection', data.value.length)
|
||||
pandora.$ui.personalListsSelect[data.value.length ? 'enableItem' : 'disableItem']('newlistfromselection');
|
||||
*/
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
})];
|
||||
})
|
||||
];
|
||||
}
|
||||
} else if (folder.id == 'favorite') {
|
||||
if (pandora.user.level == 'guest') {
|
||||
|
@ -190,7 +199,7 @@ pandora.ui.folders = function() {
|
|||
}
|
||||
pandora.$ui.folder[i] = Ox.CollapsePanel({
|
||||
id: folder.id,
|
||||
collapsed: !pandora.user.ui.showFolder.items[folder.id],
|
||||
collapsed: !ui.showFolder.items[folder.id],
|
||||
extras: extras,
|
||||
size: 16,
|
||||
title: folder.title
|
||||
|
|
Loading…
Reference in a new issue