mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-03-13 15:08:33 +01:00
Fix label attribute in date-time readonly widget
This commit is contained in:
parent
796663c2a6
commit
1561dc1caf
@ -585,12 +585,14 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
*/
|
*/
|
||||||
init: function() {
|
init: function() {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
|
this.label_node = $j(document.createElement("label"))
|
||||||
|
.addClass("et2_label");
|
||||||
this.value = "";
|
this.value = "";
|
||||||
this.span = $j(document.createElement(this._type == "date-since" || this._type == "date-time_today" ? "span" : "time"))
|
this.span = $j(document.createElement(this._type == "date-since" || this._type == "date-time_today" ? "span" : "time"))
|
||||||
.addClass("et2_date_ro et2_label");
|
.addClass("et2_date_ro et2_label")
|
||||||
|
.appendTo(this.label_node);
|
||||||
|
|
||||||
this.setDOMNode(this.span[0]);
|
this.setDOMNode(this.label_node[0]);
|
||||||
},
|
},
|
||||||
|
|
||||||
set_value: function(_value) {
|
set_value: function(_value) {
|
||||||
@ -685,7 +687,7 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
* @param {array} _attrs array to add further attributes to
|
* @param {array} _attrs array to add further attributes to
|
||||||
*/
|
*/
|
||||||
getDetachedAttributes: function(_attrs) {
|
getDetachedAttributes: function(_attrs) {
|
||||||
_attrs.push("value", "class");
|
_attrs.push("label", "value","class");
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -695,7 +697,7 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
* @return {array}
|
* @return {array}
|
||||||
*/
|
*/
|
||||||
getDetachedNodes: function() {
|
getDetachedNodes: function() {
|
||||||
return [this.span[0]];
|
return [this.label_node[0], this.span[0]];
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -709,9 +711,14 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
* given values.
|
* given values.
|
||||||
*/
|
*/
|
||||||
setDetachedAttributes: function(_nodes, _values) {
|
setDetachedAttributes: function(_nodes, _values) {
|
||||||
this.span = jQuery(_nodes[0]);
|
this.label_node = jQuery(_nodes[0]);
|
||||||
this.set_value(_values["value"]);
|
this.span = jQuery(_nodes[1]);
|
||||||
|
|
||||||
|
this.set_value(_values["value"]);
|
||||||
|
if(_values["label"])
|
||||||
|
{
|
||||||
|
this.set_label(_values["label"]);
|
||||||
|
}
|
||||||
if(_values["class"])
|
if(_values["class"])
|
||||||
{
|
{
|
||||||
this.span.addClass(_values["class"]);
|
this.span.addClass(_values["class"]);
|
||||||
|
Loading…
Reference in New Issue
Block a user