Implement groupbox/caption with fieldset/legend

This commit is contained in:
Nathan Gray 2012-03-19 21:06:02 +00:00
parent b89f39785d
commit ccaa65b0e4
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,50 @@
/**
* eGroupWare eTemplate2 - JS Groupbox object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
* @subpackage api
* @link http://www.egroupware.org
* @author Nathan Gray
* @copyright Nathan Gray 2012
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_baseWidget;
*/
/**
* Class which implements the hrule tag
*/
var et2_groupbox = et2_baseWidget.extend({
init: function() {
this._super.apply(this, arguments);
this.setDOMNode(document.createElement("fieldset"));
}
});
et2_register_widget(et2_groupbox, ["groupbox"]);
var et2_groupbox_legend = et2_baseWidget.extend({
attributes: {
"label": {
"name": "Label",
"type": "string",
"default": "",
"description": "Label for group box"
}
},
init: function() {
this._super.apply(this, arguments);
var legend = jQuery("<legend>"+this.options.label+"</legend>");
this.setDOMNode(legend[0]);
}
});
et2_register_widget(et2_groupbox_legend, ["caption"]);

View File

@ -16,6 +16,7 @@
et2_widget_grid;
et2_widget_box;
et2_widget_hbox;
et2_widget_groupbox;
et2_widget_button;
et2_widget_description;
et2_widget_textbox;