mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-23 21:22:48 +01:00
fixed html builder component
This commit is contained in:
@@ -4,9 +4,20 @@
|
||||
this.sb = [];
|
||||
}
|
||||
|
||||
HtmlBuilder.prototype.element = function(tagName, arg) {
|
||||
var attrs = typeof arg == "object" ? arg : { html: arg},
|
||||
elementContent = attrs.html || '';
|
||||
HtmlBuilder.prototype.element = function(tagName, arg1, arg2) {
|
||||
var attrs, elementContent;
|
||||
|
||||
if(typeof arg1 == "object") {
|
||||
attrs = arg1;
|
||||
}
|
||||
else if(typeof arg1 == "string") {
|
||||
attrs = { html: arg1 };
|
||||
}
|
||||
else {
|
||||
attrs = {};
|
||||
}
|
||||
|
||||
elementContent = attrs.html || arg2;
|
||||
|
||||
this.sb.push('<' + tagName + ' ' + getAttributesStr(attrs) + ">");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user