Add support for Component#suffix, to define a linked label that should appear after the input element.

This commit is contained in:
Jürg Lehni 2014-09-29 15:46:04 +02:00
parent c2cb3e3342
commit 214ac10d57

View file

@ -146,6 +146,18 @@ var Component = Base.extend(Callback, /** @lends Component# */{
'text', label + ':');
},
getSuffix: function() {
return this._suffix;
},
setSuffix: function(suffix) {
this._suffix = suffix;
DomElement.set(this._suffixNode = this._suffixNode
|| this._input.parentNode.appendChild(DomElement.create('label',
{ 'for': 'palettejs-input-' + this._name })),
'text', suffix);
},
getOptions: function() {
return this._options;
},