From a7b14f9e0a644ec9aa050f86ab0df8c67dab42f1 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 3 Jan 2012 13:05:22 +0530 Subject: [PATCH] fix optionsGroupOffset for multiple groups and seperators --- source/Ox.UI/js/Menu/Ox.Menu.js | 6 ++++-- source/Ox.UI/js/Video/Ox.VideoEditor.js | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/source/Ox.UI/js/Menu/Ox.Menu.js b/source/Ox.UI/js/Menu/Ox.Menu.js index cd1c6059..229c6a9b 100644 --- a/source/Ox.UI/js/Menu/Ox.Menu.js +++ b/source/Ox.UI/js/Menu/Ox.Menu.js @@ -287,8 +287,10 @@ Ox.Menu = function(options, self) { 'min' in item ? item.min : 1, 'max' in item ? item.max : 1 ); - self.optionGroupOffset[item.group] = i + offset; - offset += items[i].length - 1; + self.optionGroupOffset[item.group] = offset; + offset += items[i].length; + } else if ('id' in item) { + offset += 1; } }); items = Ox.flatten(items); diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index f4544970..d88d115c 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -447,7 +447,11 @@ Ox.VideoEditor = function(options, self) { title: 'Keyboard Shortcuts', width: 256 }).open(); - } else if (id == 'resolution') { + } + }, + change: function(data) { + Ox.print('CHANGE', data); + if (data.id == 'resolution') { self.options.resolution = parseInt(data.checked[0].id); self.$player[0].options({resolution: self.options.resolution}); }