1
0
Fork 0
forked from 0x2620/oxjs

various focus/selection fixes

This commit is contained in:
j 2012-01-27 23:58:44 +05:30
commit ed4f7f0c2d
4 changed files with 15 additions and 9 deletions

View file

@ -140,7 +140,6 @@ Ox.AnnotationFolder = function(options, self) {
})
.bindEvent({
select: function(data) {
Ox.print('SELECT >>> ', data)
if (!data.id && self.options.selected && Ox.getObjectById(self.options.items, self.options.selected).event) {
// only deselect annotation if the event deselect was not
// caused by switching to an annotation without event
@ -246,6 +245,10 @@ Ox.AnnotationFolder = function(options, self) {
);
self.options.selected && setTimeout(function() {
// need timeout in order to trigger events
if (self.options.collapsed) {
self.$panel.options({collapsed: false});
}
selectAnnotation({id: self.options.selected});
}, 0);
@ -435,6 +438,10 @@ Ox.AnnotationFolder = function(options, self) {
function toggleLayer() {
self.options.collapsed = !self.options.collapsed;
if (self.options.collapsed) {
self.editing && that.blurItem();
self.$annotations.loseFocus();
}
that.triggerEvent('togglelayer', {collapsed: self.options.collapsed});
}
@ -484,7 +491,6 @@ Ox.AnnotationFolder = function(options, self) {
self.editing = false;
}
if (value && self.options.collapsed) {
Ox.print('HELLO??')
self.$panel.options({collapsed: false});
}
self.$annotations.options({selected: value});
@ -514,6 +520,7 @@ Ox.AnnotationFolder = function(options, self) {
Ox.print('FOLDER ADD ITEM', item)
var pos = 0;
self.options.items.splice(pos, 0, item);
self.$panel.options({collapsed: false});
self.$annotations
.addItem(pos, item)
.options({selected: item.id})
@ -532,6 +539,7 @@ Ox.AnnotationFolder = function(options, self) {
that.editItem = function() {
self.editing = true;
self.$panel.options({collapsed: false});
self.$annotations.editItem();
return that;
};

View file

@ -210,7 +210,6 @@ Ox.VideoEditor = function(options, self) {
// the following is needed to determine
// how to handle annotation input blur
if (self.editing) {
Ox.print('FOCUSED')
self.focused = true;
setTimeout(function() {
// annotation folder will gain focus on blur
@ -397,7 +396,7 @@ Ox.VideoEditor = function(options, self) {
{key: 'S', action: 'Select Current Annotation'},
{key: 'E', action: 'Edit Selected Annotation'},
{key: Ox.UI.symbols['return'], action: 'Submit'},
{key: Ox.UI.symbols.escape, action: 'Cancel'},
{key: Ox.UI.symbols.escape, action: 'Cancel'}
].forEach(function(shortcut) {
self.$keyboardShortcuts.append(
$('<div>').css({display: 'table-row'})