Skip to content

Commit

Permalink
Fix progress meter
Browse files Browse the repository at this point in the history
Make HTML input handle focus
  • Loading branch information
Inviz committed Jun 24, 2011
1 parent 2397567 commit 71c8c76
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
31 changes: 14 additions & 17 deletions Source/Input/HTML.js
Expand Up @@ -24,34 +24,31 @@ provides:
LSD.Widget.Input.Html = LSD.Widget.Input.HTML = new Class({
options: {
tag: 'input',
pseudos: Array.fast('focusable', 'form-associated'),
pseudos: Array.fast('form-associated'),
attributes: {
contenteditable: 'editor'
contenteditable: 'editor',
tabindex: 0
},
states: Array.fast('editing'),
events: {
element: {
click: 'edit'
},
self: {
focus: 'edit'
focus: 'edit',
edit: function() {
this.openEditor();
},
finish: 'closeEditor'
}
}
},

edit: function() {
this.useEditor(function(editor) {
console.log('editor ready', editor)
})
},

finish: function() {

getValue: function() {
if (this.editing && this.editor) return this.editor.getData();
return this.element.get('html');
},

getValue: function() {
if (this.editor) this.editor.updateElement();
return this.element.get('value')
writeValue: function(value) {
if (this.editing && this.editor) return this.editor.setData(value);
return this.element.set('html', value);
}

})
2 changes: 1 addition & 1 deletion Source/Progress.js
Expand Up @@ -10,7 +10,7 @@ license: Public domain (http://unlicense.org).
authors: Yaroslaff Fedin
requires:
- LSD.Widget
- LSD/LSD.Widget
provides:
- LSD.Widget.Progress
Expand Down

0 comments on commit 71c8c76

Please sign in to comment.