some more minor fixes

This commit is contained in:
rolux 2011-01-14 11:20:11 +00:00
parent 6b42efcc8b
commit 0cabd3f7d4

View file

@ -1670,7 +1670,8 @@ var pandora = new Ox.App({
query: query query: query
}), callback); }), callback);
}, },
selected: app.user.ui.list ? [app.user.ui.list] : [], // fixme: select if previously selected
// selected: app.user.ui.list ? [app.user.ui.list] : [],
sort: [ sort: [
{key: 'name', operator: '+'} {key: 'name', operator: '+'}
] ]
@ -1689,10 +1690,12 @@ var pandora = new Ox.App({
id: data.id, id: data.id,
status: that.value(data.id, 'status') == 'featured' ? 'public' : 'featured' status: that.value(data.id, 'status') == 'featured' ? 'public' : 'featured'
}, function(result) { }, function(result) {
Ox.Request.emptyCache(); // fixme: remove if (result.data.user == app.user.username || result.data.subscribed) {
app.$ui.sectionList[ Ox.Request.emptyCache(); // fixme: remove
result.data.user == app.user.username ? 0 : 1 app.$ui.sectionList[
].reloadList(); result.data.user == app.user.username ? 0 : 1
].reloadList();
}
that.value(data.id, 'status', result.data.status); that.value(data.id, 'status', result.data.status);
}); });
} }
@ -1709,9 +1712,10 @@ var pandora = new Ox.App({
}, },
select: function(event, data) { select: function(event, data) {
// fixme: duplicated // fixme: duplicated
Ox.print("HELLO")
if (data.ids.length) { if (data.ids.length) {
app.$ui.sectionList.forEach(function($list, i_) { app.$ui.sectionList.forEach(function($list, i_) {
i != i && $list.options('selected', []); i != i_ && $list.options('selected', []);
}); });
URL.set('?find=list:' + data.ids[0]); URL.set('?find=list:' + data.ids[0]);
} else { } else {
@ -2515,10 +2519,13 @@ var pandora = new Ox.App({
id: data.ids[0], id: data.ids[0],
status: 'public' status: 'public'
}, function(result) { }, function(result) {
Ox.Request.emptyCache(); // fixme: remove // fixme: duplicated
app.$ui.sectionList[ if (result.data.user == app.user.username || result.data.subscribed) {
result.data.user == app.user.username ? 0 : 1 Ox.Request.emptyCache(); // fixme: remove
].reloadList(); app.$ui.sectionList[
result.data.user == app.user.username ? 0 : 1
].reloadList();
}
$list.reloadList(); $list.reloadList();
}); });
} }
@ -2634,6 +2641,7 @@ var pandora = new Ox.App({
}) })
.bindEvent({ .bindEvent({
change: function(event, data) { change: function(event, data) {
Ox.Request.emptyCache(); // fixme: remove
app.ui.showPublicListsBrowser = !app.ui.showPublicListsBrowser; app.ui.showPublicListsBrowser = !app.ui.showPublicListsBrowser;
if (app.ui.showPublicListsBrowser) { if (app.ui.showPublicListsBrowser) {
app.$ui.sectionList[1].replaceWith(app.$ui.publicListsBrowser = ui.listsBrowser('public')); app.$ui.sectionList[1].replaceWith(app.$ui.publicListsBrowser = ui.listsBrowser('public'));
@ -2652,6 +2660,7 @@ var pandora = new Ox.App({
}) })
.bindEvent({ .bindEvent({
change: function(event, data) { change: function(event, data) {
Ox.Request.emptyCache(); // fixme: remove
app.ui.showFeaturedListsBrowser = !app.ui.showFeaturedListsBrowser; app.ui.showFeaturedListsBrowser = !app.ui.showFeaturedListsBrowser;
if (app.ui.showFeaturedListsBrowser) { if (app.ui.showFeaturedListsBrowser) {
app.$ui.sectionList[2].replaceWith(app.$ui.featuredListsBrowser = ui.listsBrowser('featured')); app.$ui.sectionList[2].replaceWith(app.$ui.featuredListsBrowser = ui.listsBrowser('featured'));
@ -2659,7 +2668,8 @@ var pandora = new Ox.App({
app.$ui.featuredListsBrowser.replaceWith(app.$ui.sectionList[2] = ui.sectionList('featured')); app.$ui.featuredListsBrowser.replaceWith(app.$ui.sectionList[2] = ui.sectionList('featured'));
} }
} }
})]; } })];
}
app.$ui.section[i] = new Ox.CollapsePanel({ app.$ui.section[i] = new Ox.CollapsePanel({
id: id, id: id,
extras: extras, extras: extras,
@ -2940,6 +2950,7 @@ var pandora = new Ox.App({
function getSectionsWidth() { function getSectionsWidth() {
var width = app.user.ui.sidebarSize; var width = app.user.ui.sidebarSize;
// fixme: don't use height(), look up in splitpanels // fixme: don't use height(), look up in splitpanels
Ox.print('>', app.$ui.leftPanel.height() - 24 - 1 - app.$ui.info.height())
if (getSectionsHeight() > app.$ui.leftPanel.height() - 24 - 1 - app.$ui.info.height()) { if (getSectionsHeight() > app.$ui.leftPanel.height() - 24 - 1 - app.$ui.info.height()) {
width -= app.ui.scrollbarSize; width -= app.ui.scrollbarSize;
} }