always go to availabale item view after upload

This commit is contained in:
j 2014-02-13 12:01:17 +00:00
parent a32435b577
commit f6b28485e1

View file

@ -6,6 +6,7 @@ pandora.ui.uploadVideoDialog = function(data) {
var cancelled = false, var cancelled = false,
file, file,
hasFirefogg = !(typeof Firefogg == 'undefined'), hasFirefogg = !(typeof Firefogg == 'undefined'),
itemView = pandora.site.capabilities.canSeeExtraItemViews[pandora.user.level] ? 'media' : 'info',
selectFile, selectFile,
$actionButton, $actionButton,
$closeButton, $closeButton,
@ -177,13 +178,12 @@ pandora.ui.uploadVideoDialog = function(data) {
done: function(data) { done: function(data) {
if (data.progress == 1) { if (data.progress == 1) {
Ox.Request.clearCache(); Ox.Request.clearCache();
if (pandora.user.ui.item == item && pandora.user.ui.itemView == 'media') { if (pandora.user.ui.item == item && pandora.user.ui.itemView == itemView) {
pandora.$ui.item.reload(); pandora.$ui.item.reload();
} else { } else {
pandora.UI.set({ pandora.UI.set({
item: item, item: item,
itemView: pandora.site.capabilities.canSeeExtraItemViews[pandora.user.level] itemView: itemView
? 'media' : 'info'
}); });
} }
delete pandora.firefogg; delete pandora.firefogg;
@ -233,12 +233,12 @@ pandora.ui.uploadVideoDialog = function(data) {
done: function(data) { done: function(data) {
if (data.progress == 1) { if (data.progress == 1) {
Ox.Request.clearCache(); Ox.Request.clearCache();
if (pandora.user.ui.item == item && pandora.user.ui.itemView == 'media') { if (pandora.user.ui.item == item && pandora.user.ui.itemView == itemView) {
pandora.$ui.item.reload(); pandora.$ui.item.reload();
} else { } else {
pandora.UI.set({ pandora.UI.set({
item: item, item: item,
itemView: 'media' itemView: itemView
}); });
} }
that.close(); that.close();
@ -259,7 +259,7 @@ pandora.ui.uploadVideoDialog = function(data) {
} else { } else {
pandora.UI.set({ pandora.UI.set({
item: result.data.items[0].item, item: result.data.items[0].item,
itemView: 'media' itemView: itemView
}); });
that.close(); that.close();
} }
@ -427,7 +427,7 @@ pandora.ui.uploadVideoDialog = function(data) {
}, function(result) { }, function(result) {
pandora.UI.set({ pandora.UI.set({
item: result.data.items[0].id, item: result.data.items[0].id,
itemView: 'media' itemView: itemView
}); });
delete pandora.firefogg; delete pandora.firefogg;
that.close(); that.close();