isClipView/isVideoView: if no arguments are present, take into account ui.section

This commit is contained in:
rolux 2014-02-12 13:39:01 +05:30
parent 5c5102baf0
commit d4a206a41a

View file

@ -1860,12 +1860,14 @@ pandora.hasPlacesLayer = function() {
}; };
pandora.isClipView = function(view, item) { pandora.isClipView = function(view, item) {
if (pandora.user.ui.section == 'items') {
if (arguments.length == 0) { if (arguments.length == 0) {
item = pandora.user.ui.item; item = pandora.user.ui.item;
view = !item ? pandora.user.ui.listView : pandora.user.ui.itemView; view = !item ? pandora.user.ui.listView : pandora.user.ui.itemView;
} else if (arguments.length == 1) { } else if (arguments.length == 1) {
item = pandora.user.ui.item; item = pandora.user.ui.item;
} }
}
return ( return (
!item ? ['calendar', 'clip', 'map'] : ['calendar', 'clips', 'map'] !item ? ['calendar', 'clip', 'map'] : ['calendar', 'clips', 'map']
).indexOf(view) > -1; ).indexOf(view) > -1;
@ -1889,12 +1891,14 @@ pandora.isPrintURL = function(url) {
}; };
pandora.isVideoView = function(view, item) { pandora.isVideoView = function(view, item) {
if (pandora.user.ui.section == 'items') {
if (arguments.length == 0) { if (arguments.length == 0) {
item = pandora.user.ui.item; item = pandora.user.ui.item;
view = !item ? pandora.user.ui.listView : pandora.user.ui.itemView; view = !item ? pandora.user.ui.listView : pandora.user.ui.itemView;
} else if (arguments.length == 1) { } else if (arguments.length == 1) {
item = pandora.user.ui.item; item = pandora.user.ui.item;
} }
}
return ( return (
!item ? ['video'] : ['player', 'editor', 'timeline'] !item ? ['video'] : ['player', 'editor', 'timeline']
).indexOf(view) > -1; ).indexOf(view) > -1;