Merge "Add prependLabel() method in ActionContext"
This commit is contained in:
@@ -385,6 +385,10 @@ functions to make working with DOM based widgets less painful.
|
||||
and the string `label`. Used to wrap a checkbox with its label,
|
||||
`label(checkbox(), 'Click Me')`.
|
||||
|
||||
* `prependLabel(label, c)`: a new `<label>` element wrapping element `c`
|
||||
and the string `label`. Used to wrap an input field with its label,
|
||||
`prependLabel('Greeting message', textfield())`.
|
||||
|
||||
* `textarea(options)`: new `<textarea>` element. The options
|
||||
object may optionally include `rows` and `cols`. The textarea
|
||||
comes with an onkeypress handler installed to play nicely with
|
||||
|
@@ -62,6 +62,12 @@ public class ActionContext extends JavaScriptObject {
|
||||
e.appendChild(doc.createTextNode(label));
|
||||
return e;
|
||||
},
|
||||
prependLabel: function(label,c) {
|
||||
var e = doc.createElement('label');
|
||||
e.appendChild(doc.createTextNode(label));
|
||||
e.appendChild(c);
|
||||
return e;
|
||||
},
|
||||
span: function() {
|
||||
var e = doc.createElement('span');
|
||||
for (var i = 0; i < arguments.length; i++)
|
||||
|
Reference in New Issue
Block a user