- remove editItem from Ox.List
- use ArrayEditable for text too
This commit is contained in:
parent
66934d22a9
commit
093edd57d0
12 changed files with 180 additions and 403 deletions
|
|
@ -1538,56 +1538,6 @@ Ox.List = function(options, self) {
|
|||
return that;
|
||||
};
|
||||
|
||||
/*@
|
||||
editItem <f> turn item into edit form
|
||||
(pos) -> <u> edit item at position
|
||||
pos <n> position of item to edit
|
||||
@*/
|
||||
that.editItem = function(pos) {
|
||||
var $input,
|
||||
item = self.options.items[pos],
|
||||
$item = self.$items[pos],
|
||||
width = $item.width(), // fixme: don't lookup in DOM
|
||||
height = $item.height();
|
||||
$item
|
||||
.height(height + 8 + 16)
|
||||
.empty()
|
||||
.addClass('OxEdit');
|
||||
|
||||
$input = Ox.ItemInput({
|
||||
type: 'textarea',
|
||||
value: item.value,
|
||||
height: height,
|
||||
width: width
|
||||
}).bindEvent({
|
||||
cancel: cancel,
|
||||
remove: remove,
|
||||
save: submit
|
||||
}).appendTo($item.$element);
|
||||
/*
|
||||
setTimeout(function() {
|
||||
$input.gainFocus();
|
||||
$input.focus();
|
||||
});
|
||||
*/
|
||||
function cancel() {
|
||||
$item.options('data', item);
|
||||
that.triggerEvent('cancel', item);
|
||||
loadItems();
|
||||
}
|
||||
function remove() {
|
||||
that.triggerEvent('remove', item.id);
|
||||
}
|
||||
function submit(data) {
|
||||
item.value = data.value;
|
||||
//$input.loseFocus().remove();
|
||||
// fixme: leaky, inputs remain in focus stack
|
||||
$item.options('data', item);
|
||||
that.triggerEvent('submit', item);
|
||||
loadItems();
|
||||
}
|
||||
}
|
||||
|
||||
/*@
|
||||
paste <f> paste data
|
||||
(data) -> <o> the list
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue