Etemplate: fix date widget popup could not be clicked

This commit is contained in:
nathangray 2021-05-17 11:49:56 -06:00
parent fbd37c51ec
commit a4199de696
2 changed files with 44 additions and 2 deletions

View File

@ -142,8 +142,26 @@ var et2_date = /** @class */ (function (_super) {
this.set_value(null); this.set_value(null);
} }
}; };
/**
* Calendar popup sets the ID of the input, we can't change that like other inputWidgets can
*
* @param _value
*/
et2_date.prototype.set_id = function (_value) {
this.id = _value;
this.dom_id = _value && this.getInstanceManager() ? this.getInstanceManager().uniqueId + '_' + this.id : _value;
var node = this.getDOMNode(this);
if (node) {
if (_value != "") {
node.setAttribute("id", this.dom_id);
}
else {
node.removeAttribute("id");
}
}
};
et2_date.prototype.getInputNode = function () { et2_date.prototype.getInputNode = function () {
return this.input_date[0]; return this.options.inline ? _super.prototype.getInputNode.call(this) : this.input_date[0];
}; };
et2_date.prototype.set_type = function (_type) { et2_date.prototype.set_type = function (_type) {
if (_type != this.getType()) { if (_type != this.getType()) {

View File

@ -210,9 +210,33 @@ String: A string in the user\'s date format, or a relative date. Relative dates
} }
} }
/**
* Calendar popup sets the ID of the input, we can't change that like other inputWidgets can
*
* @param _value
*/
set_id(_value)
{
this.id = _value;
this.dom_id = _value && this.getInstanceManager() ? this.getInstanceManager().uniqueId+'_'+this.id : _value;
var node = this.getDOMNode(this);
if (node)
{
if (_value != "")
{
node.setAttribute("id", this.dom_id);
}
else
{
node.removeAttribute("id");
}
}
}
getInputNode(): HTMLElement getInputNode(): HTMLElement
{ {
return this.input_date[0]; return this.options.inline ? super.getInputNode() : this.input_date[0];
} }
set_type(_type) set_type(_type)