forked from 0x2620/oxjs
update video editor
This commit is contained in:
parent
f5d587cf5b
commit
7da384d03a
5 changed files with 98 additions and 38 deletions
|
|
@ -60,11 +60,13 @@ Ox.ArrayEditable = function(options, self) {
|
|||
if (!$target.is('.OxInput')) {
|
||||
Ox.print('BLURRED EDITING', self.blurred, self.editing)
|
||||
if ($parent.is('.OxEditableElement')) {
|
||||
// select another item
|
||||
selectItem(
|
||||
e.metaKey && position == self.selected
|
||||
? '' : $parent.data('position')
|
||||
);
|
||||
if (!$parent.is('.OxSelected')) {
|
||||
// select another item
|
||||
selectItem(
|
||||
e.metaKey && position == self.selected
|
||||
? '' : $parent.data('position')
|
||||
);
|
||||
}
|
||||
} else if (!self.blurred) {
|
||||
// if there wasn't an active input element
|
||||
if (self.editing) {
|
||||
|
|
@ -197,27 +199,21 @@ Ox.ArrayEditable = function(options, self) {
|
|||
}
|
||||
|
||||
function selectItem(idOrPosition) {
|
||||
var isId = Ox.isString(idOrPosition);
|
||||
if (
|
||||
(isId && idOrPosition != self.options.selected)
|
||||
|| (!isId && idOrPosition != self.selected)
|
||||
) {
|
||||
if (isId) {
|
||||
self.options.selected = idOrPosition;
|
||||
self.selected = getSelectedPosition();
|
||||
} else {
|
||||
self.selected = idOrPosition;
|
||||
self.options.selected = getSelectedId();
|
||||
}
|
||||
if (/*self.options.selected == '' && */self.editing) {
|
||||
self.editing = false;
|
||||
that.blurItem();
|
||||
}
|
||||
Ox.print('SELECT ITEM', self.options.selected, self.selected);
|
||||
that.find('.OxSelected').removeClass('OxSelected');
|
||||
self.selected > -1 && self.$items[self.selected].addClass('OxSelected');
|
||||
triggerSelectEvent();
|
||||
if (Ox.isString(idOrPosition)) {
|
||||
self.options.selected = idOrPosition;
|
||||
self.selected = getSelectedPosition();
|
||||
} else {
|
||||
self.selected = idOrPosition;
|
||||
self.options.selected = getSelectedId();
|
||||
}
|
||||
if (/*self.options.selected == '' && */self.editing) {
|
||||
self.editing = false;
|
||||
that.blurItem();
|
||||
}
|
||||
Ox.print('SELECT ITEM', self.options.selected, self.selected);
|
||||
that.find('.OxSelected').removeClass('OxSelected');
|
||||
self.selected > -1 && self.$items[self.selected].addClass('OxSelected');
|
||||
triggerSelectEvent();
|
||||
}
|
||||
|
||||
function selectLast() {
|
||||
|
|
@ -263,6 +259,8 @@ Ox.ArrayEditable = function(options, self) {
|
|||
that.triggerEvent('select', Ox.extend({
|
||||
id: self.options.selected
|
||||
}, self.options.selected ? {
|
||||
height: self.$items[self.selected].$element.height()
|
||||
+ (self.options.type == 'textarea' ? 8 : 0),
|
||||
top: self.$items[self.selected].offset().top
|
||||
} : {}));
|
||||
self.triggered = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue