forked from 0x2620/oxjs
video editor update
This commit is contained in:
parent
ba9423462f
commit
88f31a5ae3
10 changed files with 245 additions and 65 deletions
|
|
@ -21,7 +21,7 @@ Ox.ArrayEditable = function(options, self) {
|
|||
width: 256
|
||||
})
|
||||
.options(options || {})
|
||||
.addClass('OxArrayEditable')
|
||||
.addClass('OxArrayEditable OxArrayEditable' + Ox.toTitleCase(self.options.type))
|
||||
.css({width: self.options.width - 8 + 'px'}) // 2 x 4 px padding
|
||||
.bindEvent({
|
||||
anyclick: anyclick,
|
||||
|
|
@ -29,10 +29,10 @@ Ox.ArrayEditable = function(options, self) {
|
|||
key_delete: deleteItem,
|
||||
key_enter: editItem,
|
||||
key_escape: selectNone,
|
||||
key_down: selectLast,
|
||||
key_left: selectPrevious,
|
||||
key_right: selectNext,
|
||||
key_up: selectFirst
|
||||
key_down: self.options.type == 'input' ? selectLast : selectNext,
|
||||
key_left: self.options.type == 'input' ? selectPrevious : selectFirst,
|
||||
key_right: self.options.type == 'input' ? selectNext : selectLast,
|
||||
key_up: self.options.type == 'input' ? selectFirst : selectPrevious
|
||||
});
|
||||
|
||||
self.$items = [];
|
||||
|
|
@ -122,7 +122,7 @@ Ox.ArrayEditable = function(options, self) {
|
|||
),
|
||||
type: self.options.type,
|
||||
value: item.value,
|
||||
width: self.options.type == 'input' ? 0 : self.options.width
|
||||
width: self.options.type == 'input' ? 0 : self.options.width - 8
|
||||
})
|
||||
.addClass(item.id == self.options.selected ? 'OxSelected' : '')
|
||||
.data({position: i})
|
||||
|
|
@ -160,7 +160,7 @@ Ox.ArrayEditable = function(options, self) {
|
|||
}
|
||||
that.find('.OxSelected').removeClass('OxSelected');
|
||||
self.selected > -1 && self.$items[self.selected].addClass('OxSelected');
|
||||
that.triggerEvent('select', {id: self.options.selected});
|
||||
triggerSelectEvent();
|
||||
}
|
||||
|
||||
function selectLast() {
|
||||
|
|
@ -197,6 +197,16 @@ Ox.ArrayEditable = function(options, self) {
|
|||
}
|
||||
}
|
||||
|
||||
function triggerSelectEvent() {
|
||||
if (!self.triggered) {
|
||||
that.triggerEvent('select', {id: self.options.selected});
|
||||
self.triggered = true;
|
||||
setTimeout(function() {
|
||||
self.triggered = false;
|
||||
}, 250);
|
||||
}
|
||||
};
|
||||
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'items') {
|
||||
renderItems();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue