From 87ba2a10ab16f48fde98f51eec78855b99e93c72 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 20 Dec 2011 19:15:24 +0530 Subject: [PATCH] video editor resolution toggle --- source/Ox.UI/js/Menu/Ox.MenuButton.js | 14 +++++++++++++- source/Ox.UI/js/Video/Ox.VideoEditor.js | 11 +++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/source/Ox.UI/js/Menu/Ox.MenuButton.js b/source/Ox.UI/js/Menu/Ox.MenuButton.js index 7b1f51b1..20951fa3 100644 --- a/source/Ox.UI/js/Menu/Ox.MenuButton.js +++ b/source/Ox.UI/js/Menu/Ox.MenuButton.js @@ -113,18 +113,30 @@ Ox.MenuButton = function(options, self) { } } + /*@ + checkItem + @*/ that.checkItem = function(id) { self.$menu.checkItem(id); }; + /*@ + disableItem + @*/ that.disableItem = function(id) { self.$menu.getItem(id).options({disabled: true}); }; + /*@ + enableItem + @*/ that.enableItem = function(id) { self.$menu.getItem(id).options({disabled: false}); }; + /*@ + remove + @*/ self.superRemove = that.remove; that.remove = function() { self.$menu.remove(); @@ -133,4 +145,4 @@ Ox.MenuButton = function(options, self) { return that; -}; \ No newline at end of file +}; diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index dbff9bfc..75bfa2a8 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -396,7 +396,10 @@ Ox.VideoEditor = function(options, self) { {id: 'toggleSize', title: 'Large Player', selected: self.options.playerSize == 'large', keyboard: 'shift +'}, {} ], - self.resolutions, + { + 'id': 'resolution', title:'Resolution', + items: [ { group: 'resolution', min: 1, max: 1, items: self.resolutions } ] + }, [ {}, {id: 'largeTimeline', title: 'Hide Large Timeline', disabled: true}, @@ -431,9 +434,9 @@ Ox.VideoEditor = function(options, self) { title: 'Keyboard Shortcuts', width: 256 }).open(); - } else if (Ox.getObjectById(self.resolutions, id)) { - //FIXME: uncheck previous resolution - self.$player[0].options({resolution: id}); + } else if (id == 'resolution') { + self.options.resolution = parseInt(data.checked[0].id); + self.$player[0].options({resolution: self.options.resolution}); } } })