mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-27 02:14:45 +01:00
68c7a5550e
- Added test for textbox - Added baseWidget and inputWidget classes - Implemented attribute system - Implemented statustext as a test for the attribute system - Ported csv_split function to JS - Implemented system for the legacy options - Added function for iterating over the widget tree
57 lines
952 B
JavaScript
57 lines
952 B
JavaScript
/**
|
|
* eGroupWare eTemplate2 - JS Button object
|
|
*
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
* @package etemplate
|
|
* @subpackage api
|
|
* @link http://www.egroupware.org
|
|
* @author Andreas Stöckel
|
|
* @copyright Stylite 2011
|
|
* @version $Id$
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
/*egw:uses
|
|
jquery.jquery;
|
|
et2_baseWidget;
|
|
*/
|
|
|
|
/**
|
|
* Class which implements the "button" XET-Tag
|
|
*/
|
|
var et2_button = et2_baseWidget.extend({
|
|
|
|
attributes: {
|
|
"label": {
|
|
"name": "caption",
|
|
"type": "string",
|
|
"description": "Label of the button"
|
|
}
|
|
},
|
|
|
|
init: function(_parent) {
|
|
this._super.apply(this, arguments);
|
|
|
|
this.label = "";
|
|
|
|
this.btn = $j(document.createElement("button"))
|
|
.addClass("et2_button");
|
|
|
|
this.setDOMNode(this.btn[0]);
|
|
},
|
|
|
|
set_label: function(_value) {
|
|
if (_value != this.value)
|
|
{
|
|
this.label = _value;
|
|
|
|
this.btn.text(_value);
|
|
}
|
|
}
|
|
|
|
});
|
|
|
|
et2_register_widget(et2_button, ["button"]);
|
|
|