forked from 0x2620/pandora
add the 'All Movies' list
This commit is contained in:
parent
71e0ab278c
commit
03ed4e74f6
4 changed files with 26 additions and 8 deletions
|
@ -301,6 +301,7 @@ pandora.ui.folderList = function(id) {
|
||||||
} else if (data.key == 'status') {
|
} else if (data.key == 'status') {
|
||||||
var status = that.value(data.id, data.key) == 'private' ? 'public' : 'private';
|
var status = that.value(data.id, data.key) == 'private' ? 'public' : 'private';
|
||||||
pandora.changeListStatus(data.id, status, function(result) {
|
pandora.changeListStatus(data.id, status, function(result) {
|
||||||
|
Ox.print('cLS', result.data);
|
||||||
that.value(result.data.id, 'status', result.data.status);
|
that.value(result.data.id, 'status', result.data.status);
|
||||||
});
|
});
|
||||||
} else if (data.key == 'path') {
|
} else if (data.key == 'path') {
|
||||||
|
|
|
@ -2,13 +2,15 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
pandora.ui.folders = function() {
|
pandora.ui.folders = function() {
|
||||||
var ui = pandora.user.ui,
|
var ui = pandora.user.ui,
|
||||||
|
counter = 0,
|
||||||
that = Ox.Element()
|
that = Ox.Element()
|
||||||
.css({overflowX: 'hidden', overflowY: 'auto'})
|
.css({overflowX: 'hidden', overflowY: 'auto'})
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
resize: pandora.resizeFolders,
|
resize: pandora.resizeFolders,
|
||||||
});
|
});
|
||||||
var counter = 0;
|
|
||||||
//var $sections = [];
|
//var $sections = [];
|
||||||
|
|
||||||
|
pandora.$ui.allItems = pandora.ui.allItems().appendTo(that);
|
||||||
pandora.$ui.folder = [];
|
pandora.$ui.folder = [];
|
||||||
pandora.$ui.folderBrowser = {};
|
pandora.$ui.folderBrowser = {};
|
||||||
pandora.$ui.folderList = {};
|
pandora.$ui.folderList = {};
|
||||||
|
|
|
@ -23,7 +23,7 @@ pandora.ui.listDialog = function(section) {
|
||||||
} else if (id == 'icon') {
|
} else if (id == 'icon') {
|
||||||
return pandora.ui.listIconPanel(listData);
|
return pandora.ui.listIconPanel(listData);
|
||||||
} else if (id == 'query') {
|
} else if (id == 'query') {
|
||||||
return pandora.$ui.filter = pandora.ui.filter(listData);
|
return pandora.$ui.filterForm = pandora.ui.filterForm(listData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tabs: tabs
|
tabs: tabs
|
||||||
|
@ -244,8 +244,14 @@ pandora.ui.listGeneralPanel = function(listData) {
|
||||||
}
|
}
|
||||||
function editStatus(data) {
|
function editStatus(data) {
|
||||||
var status = data.selected[0].id;
|
var status = data.selected[0].id;
|
||||||
|
$statusSelect.value(status == 'private' ? 'public' : 'private');
|
||||||
pandora.changeListStatus(listData.id, status, function(result) {
|
pandora.changeListStatus(listData.id, status, function(result) {
|
||||||
listData.status = result.data.status;
|
listData.status = result.data.status;
|
||||||
|
if (result.data.status == 'private') {
|
||||||
|
subscribers = 0;
|
||||||
|
$subscribersInput.options({value: 0});
|
||||||
|
}
|
||||||
|
$statusSelect.value(result.data.status);
|
||||||
$subscribersInput[getSubscribersAction()]();
|
$subscribersInput[getSubscribersAction()]();
|
||||||
$descriptionInput
|
$descriptionInput
|
||||||
.options({height: getDescriptionHeight()})
|
.options({height: getDescriptionHeight()})
|
||||||
|
|
|
@ -140,12 +140,20 @@ pandora.changeListStatus = function(id, status, callback) {
|
||||||
if (status == 'private') {
|
if (status == 'private') {
|
||||||
pandora.api.findLists({
|
pandora.api.findLists({
|
||||||
query: {conditions: [{key: 'id', value: id, operator: '=='}]},
|
query: {conditions: [{key: 'id', value: id, operator: '=='}]},
|
||||||
keys: ['subscribers']
|
keys: ['name', 'subscribers']
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
var subscribers = result.data.items[0].subscribers;
|
var name = result.data.items[0].name,
|
||||||
|
subscribers = result.data.items[0].subscribers;
|
||||||
if (subscribers) {
|
if (subscribers) {
|
||||||
pandora.ui.makeListPrivateDialog(subscribers, function(makePrivate) {
|
pandora.ui.makeListPrivateDialog(name, subscribers, function(makePrivate) {
|
||||||
makePrivate && changeListStatus();
|
if (makePrivate) {
|
||||||
|
changeListStatus();
|
||||||
|
} else {
|
||||||
|
callback({data: {
|
||||||
|
id: id,
|
||||||
|
status: 'public'
|
||||||
|
}});
|
||||||
|
}
|
||||||
}).open();
|
}).open();
|
||||||
} else {
|
} else {
|
||||||
changeListStatus();
|
changeListStatus();
|
||||||
|
@ -156,7 +164,7 @@ pandora.changeListStatus = function(id, status, callback) {
|
||||||
}
|
}
|
||||||
function changeListStatus() {
|
function changeListStatus() {
|
||||||
pandora.api.editList({
|
pandora.api.editList({
|
||||||
id: is,
|
id: id,
|
||||||
status: status
|
status: status
|
||||||
}, callback);
|
}, callback);
|
||||||
}
|
}
|
||||||
|
@ -505,7 +513,7 @@ pandora.getFoldersWidth = function() {
|
||||||
Ox.Log('', 'FOLDERS HEIGHT', pandora.getFoldersHeight(), 'INFO HEIGHT', pandora.getInfoHeight())
|
Ox.Log('', 'FOLDERS HEIGHT', pandora.getFoldersHeight(), 'INFO HEIGHT', pandora.getInfoHeight())
|
||||||
if (
|
if (
|
||||||
pandora.$ui.appPanel
|
pandora.$ui.appPanel
|
||||||
&& pandora.getFoldersHeight() > window.innerHeight - 20 - 24 - 1 - pandora.getInfoHeight()
|
&& pandora.getFoldersHeight() > window.innerHeight - 20 - 24 -16 - 1 - pandora.getInfoHeight()
|
||||||
) {
|
) {
|
||||||
width -= Ox.UI.SCROLLBAR_SIZE;
|
width -= Ox.UI.SCROLLBAR_SIZE;
|
||||||
}
|
}
|
||||||
|
@ -809,6 +817,7 @@ pandora.resizeFolders = function() {
|
||||||
columnWidth.name = (width - 96) - columnWidth.user;
|
columnWidth.name = (width - 96) - columnWidth.user;
|
||||||
}
|
}
|
||||||
Ox.Log('', 'RESIZE FOLDERS', width);
|
Ox.Log('', 'RESIZE FOLDERS', width);
|
||||||
|
pandora.$ui.allItems.resizeElement(width - 104);
|
||||||
Ox.forEach(pandora.$ui.folderList, function($list, id) {
|
Ox.forEach(pandora.$ui.folderList, function($list, id) {
|
||||||
var pos = Ox.getPositionById(pandora.site.sectionFolders[pandora.user.ui.section], id);
|
var pos = Ox.getPositionById(pandora.site.sectionFolders[pandora.user.ui.section], id);
|
||||||
pandora.$ui.folder[pos].css({width: width + 'px'});
|
pandora.$ui.folder[pos].css({width: width + 'px'});
|
||||||
|
|
Loading…
Reference in a new issue