From f6b28485e1048fa663c285577ba462854781335f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 13 Feb 2014 12:01:17 +0000 Subject: [PATCH] always go to availabale item view after upload --- static/js/uploadVideoDialog.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/static/js/uploadVideoDialog.js b/static/js/uploadVideoDialog.js index ea57bb48..069cc3f9 100644 --- a/static/js/uploadVideoDialog.js +++ b/static/js/uploadVideoDialog.js @@ -6,6 +6,7 @@ pandora.ui.uploadVideoDialog = function(data) { var cancelled = false, file, hasFirefogg = !(typeof Firefogg == 'undefined'), + itemView = pandora.site.capabilities.canSeeExtraItemViews[pandora.user.level] ? 'media' : 'info', selectFile, $actionButton, $closeButton, @@ -177,13 +178,12 @@ pandora.ui.uploadVideoDialog = function(data) { done: function(data) { if (data.progress == 1) { 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(); } else { pandora.UI.set({ item: item, - itemView: pandora.site.capabilities.canSeeExtraItemViews[pandora.user.level] - ? 'media' : 'info' + itemView: itemView }); } delete pandora.firefogg; @@ -233,12 +233,12 @@ pandora.ui.uploadVideoDialog = function(data) { done: function(data) { if (data.progress == 1) { 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(); } else { pandora.UI.set({ item: item, - itemView: 'media' + itemView: itemView }); } that.close(); @@ -259,7 +259,7 @@ pandora.ui.uploadVideoDialog = function(data) { } else { pandora.UI.set({ item: result.data.items[0].item, - itemView: 'media' + itemView: itemView }); that.close(); } @@ -427,7 +427,7 @@ pandora.ui.uploadVideoDialog = function(data) { }, function(result) { pandora.UI.set({ item: result.data.items[0].id, - itemView: 'media' + itemView: itemView }); delete pandora.firefogg; that.close();