Skip to content

Commit

Permalink
added setId()
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Mar 10, 2022
1 parent 5e28524 commit c6ef083
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions domkit/Properties.hx
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,20 @@ class Properties<T:Model<T>> {
needRefresh();
}

public function setId( id : String ) {
if( this.id == id ) return;
this.id = id;
updateComponentId(this);
needRefresh();
}

public function setAttribute( p : String, value : CssValue ) : SetAttributeResult {
var p = Property.get(p,false);
if( p == null )
return Unknown;
if( p.id == pid.id ) {
switch( value ) {
case VIdent(i):
if( id != i ) {
id = i;
updateComponentId(this);
needRefresh();
}
case VIdent(i): setId(i);
default: return InvalidValue();
}
return Ok;
Expand Down

0 comments on commit c6ef083

Please sign in to comment.