update EditableContent example
This commit is contained in:
parent
e7aca0c595
commit
4c2564ffac
1 changed files with 23 additions and 6 deletions
|
@ -13,23 +13,40 @@ Ox.load('UI', function() {
|
|||
Ox.loop(1, 4, function(i) {
|
||||
Ox.$('<span>')
|
||||
.addClass('label')
|
||||
.html((i > 1 ? ' ' : '') + 'Editable ' + i + ': ')
|
||||
.html((i > 1 ? ' ' : '') + 'SPAN #' + i + ': ')
|
||||
.appendTo($box);
|
||||
Ox.EditableContent({
|
||||
placeholder: 'Placeholder ' + i,
|
||||
editing: i == 1,
|
||||
placeholder: 'Placeholder',
|
||||
tooltip: 'Doubleclick to edit'
|
||||
})
|
||||
.bindEvent({
|
||||
submit: function(data) {
|
||||
Ox.print(data.value);
|
||||
}
|
||||
})
|
||||
.appendTo($box);
|
||||
});
|
||||
|
||||
Ox.$('<div>')
|
||||
.addClass('label')
|
||||
.html('Editable 4:')
|
||||
.html('DIV')
|
||||
.appendTo($box);
|
||||
Ox.EditableContent({
|
||||
placeholder: 'Placeholder 4',
|
||||
tooltip: 'Doubleclick to edit',
|
||||
type: 'div'
|
||||
placeholder: 'Placeholder',
|
||||
tooltip: function(e) {
|
||||
var $target = $(e.target);
|
||||
return $target.is('a') || $target.parents('a').length
|
||||
? 'Shift+doubleclick to edit' : 'Doubleclick to edit';
|
||||
},
|
||||
type: 'div',
|
||||
value: 'This is a <a href="http://google.com">link</a>.'
|
||||
})
|
||||
.css({width: '512px'})
|
||||
.bindEvent({
|
||||
submit: function(data) {
|
||||
Ox.print(data.value);
|
||||
}
|
||||
})
|
||||
.appendTo($box);
|
||||
|
||||
|
|
Loading…
Reference in a new issue