update EditableContent example

This commit is contained in:
rolux 2013-02-27 13:03:55 +05:30
parent e7aca0c595
commit 4c2564ffac

View file

@ -13,23 +13,40 @@ Ox.load('UI', function() {
Ox.loop(1, 4, function(i) {
Ox.$('<span>')
.addClass('label')
.html((i > 1 ? '&nbsp;' : '') + 'Editable ' + i + ':&nbsp;')
.html((i > 1 ? '&nbsp;' : '') + 'SPAN #' + i + ':&nbsp;')
.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);