remove player/editor/timeline losefocus handlers (opening the item menu will make them lose focus), add gainfocus handler to browser; correct definition of canCut; enable mainMenu.replaceItemMenu

This commit is contained in:
rolux 2013-08-02 17:01:24 +00:00
parent 74321ebc1d
commit bcf9d37930
6 changed files with 6 additions and 15 deletions

View file

@ -133,6 +133,9 @@ pandora.ui.browser = function() {
copyadd: function() { copyadd: function() {
Ox.Clipboard.add(pandora.user.ui.item, 'item'); Ox.Clipboard.add(pandora.user.ui.item, 'item');
}, },
gainfocus: function() {
pandora.$ui.mainMenu.replaceItemMenu();
},
open: function() { open: function() {
that.scrollToSelection(); that.scrollToSelection();
}, },

View file

@ -147,9 +147,6 @@ pandora.ui.clipList = function(videoRatio) {
pandora.$ui.statusbar.set('total', data); pandora.$ui.statusbar.set('total', data);
} }
}, },
losefocus: function() {
pandora.$ui.mainMenu.replaceItemMenu();
},
open: function(data) { open: function(data) {
var id = data.ids[0], var id = data.ids[0],
item = !ui.item ? id.split('/')[0] : ui.item, item = !ui.item ? id.split('/')[0] : ui.item,

View file

@ -186,9 +186,6 @@ pandora.ui.editor = function(data) {
Ox.getObjectById(pandora.site.layers, data.layer).title Ox.getObjectById(pandora.site.layers, data.layer).title
).open(); ).open();
}, },
losefocus: function() {
pandora.$ui.mainMenu.replaceItemMenu();
},
muted: function(data) { muted: function(data) {
pandora.UI.set({videoMuted: data.muted}); pandora.UI.set({videoMuted: data.muted});
}, },

View file

@ -817,7 +817,8 @@ pandora.ui.mainMenu = function() {
: !!ui.listSelection.length, : !!ui.listSelection.length,
canPaste = !ui.item && !isClipView && !isVideoView canPaste = !ui.item && !isClipView && !isVideoView
&& listData.editable && listData.type == 'static' && Ox.Clipboard.type() == 'item', && listData.editable && listData.type == 'static' && Ox.Clipboard.type() == 'item',
canCut = canCopy && canPaste; canCut = canCopy && !ui.item && !isClipView && !isVideoView
&& listData.editable && listData.type == 'static';
return { id: 'itemMenu', title: Ox._('Item'), items: [ return { id: 'itemMenu', title: Ox._('Item'), items: [
{ id: 'add', title: Ox._('Add {0}', [Ox._(pandora.site.itemName.singular)]), disabled: pandora.site.itemRequiresVideo || !pandora.site.capabilities.canAddItems[pandora.user.level] }, { id: 'add', title: Ox._('Add {0}', [Ox._(pandora.site.itemName.singular)]), disabled: pandora.site.itemRequiresVideo || !pandora.site.capabilities.canAddItems[pandora.user.level] },
{ id: 'upload', title: Ox._('Upload Video...'), disabled: !pandora.site.capabilities.canAddItems[pandora.user.level] }, { id: 'upload', title: Ox._('Upload Video...'), disabled: !pandora.site.capabilities.canAddItems[pandora.user.level] },
@ -987,8 +988,7 @@ pandora.ui.mainMenu = function() {
} }
that.replaceItemMenu = function() { that.replaceItemMenu = function() {
// FIXME: on opening the menu, this throws in Ox.Focus that.replaceMenu('itemMenu', getItemMenu());
// that.replaceMenu('itemMenu', getItemMenu());
return that; return that;
}; };

View file

@ -98,9 +98,6 @@ pandora.ui.player = function(data) {
loop: function(data) { loop: function(data) {
pandora.UI.set({videoLoop: data.loop}); pandora.UI.set({videoLoop: data.loop});
}, },
losefocus: function() {
pandora.$ui.mainMenu.replaceItemMenu();
},
muted: function(data) { muted: function(data) {
pandora.UI.set({videoMuted: data.muted}); pandora.UI.set({videoMuted: data.muted});
}, },

View file

@ -75,9 +75,6 @@ pandora.ui.timeline = function(data) {
Ox.getObjectById(pandora.site.layers, data.layer).title Ox.getObjectById(pandora.site.layers, data.layer).title
).open(); ).open();
}, },
losefocus: function() {
pandora.$ui.mainMenu.replaceItemMenu();
},
muted: function(data) { muted: function(data) {
pandora.UI.set({videoMuted: data.muted}); pandora.UI.set({videoMuted: data.muted});
}, },