always replace dots with dashes in DOM id

This commit is contained in:
Ralf Becker 2013-08-29 12:10:06 +00:00
parent a4ec8796af
commit b6013305f7
2 changed files with 3 additions and 10 deletions

View File

@ -282,11 +282,13 @@ var et2_DOMWidget = et2_widget.extend(et2_IDOMNode,
/**
* Sets the id of the DOM-Node.
*
* DOM id's have dots "." replaced with dashes "-"
*/
set_id: function(_value) {
this.id = _value;
this.dom_id = _value ? this.getInstanceManager().uniqueId+'_'+_value : _value;
this.dom_id = _value ? this.getInstanceManager().uniqueId+'_'+_value.replace(/\./g, '-') : _value;
var node = this.getDOMNode(this);
if (node)

View File

@ -164,15 +164,6 @@ var et2_template = et2_DOMWidget.extend(
getDOMNode: function() {
return this.div;
},
/**
* Replace . in template-ids with - to simplify css usage, as we do it the unique id already
*
* @param _id
*/
set_id: function(_id) {
this._super.call(this, _id.replace(/\./g, '-'));
}
});
et2_register_widget(et2_template, ["template"]);