forked from 0x2620/oxjs
update video editor
This commit is contained in:
parent
43d04f242d
commit
ef82ff8967
3 changed files with 17 additions and 12 deletions
|
|
@ -37,10 +37,11 @@ Ox.ArrayEditable = function(options, self) {
|
|||
});
|
||||
|
||||
self.$items = [];
|
||||
self.selected = getSelectedPosition();
|
||||
|
||||
renderItems();
|
||||
|
||||
self.selected = getSelectedPosition();
|
||||
|
||||
function anyclick(e) {
|
||||
var $target = $(e.target),
|
||||
$parent = $target.parent(),
|
||||
|
|
@ -107,11 +108,8 @@ Ox.ArrayEditable = function(options, self) {
|
|||
|
||||
function renderItems() {
|
||||
that.empty();
|
||||
(
|
||||
Ox.isEmpty(self.options.sort)
|
||||
? self.options.items
|
||||
: Ox.sortBy(self.options.items, self.options.sort)
|
||||
).forEach(function(item, i) {
|
||||
sortItems();
|
||||
self.options.items.forEach(function(item, i) {
|
||||
i && self.options.type == 'input'
|
||||
&& $('<span>')
|
||||
.html(', ')
|
||||
|
|
@ -186,6 +184,13 @@ Ox.ArrayEditable = function(options, self) {
|
|||
self.selected > 0 && selectItem(self.selected - 1);
|
||||
}
|
||||
|
||||
function sortItems() {
|
||||
if (!Ox.isEmpty(self.options.sort)) {
|
||||
self.options.items = Ox.sortBy(self.options.items, self.options.sort);
|
||||
self.selected = getSelectedPosition();
|
||||
}
|
||||
}
|
||||
|
||||
function submit(position, value) {
|
||||
var item = self.options.items[position];
|
||||
if (value === '') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue