You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
561 B
22 lines
561 B
export const registAttrFun = (Element) => { |
|
Element.registerFunction('attr', function (key, value) { |
|
var self = this; |
|
if (BI.isObject(key)) { |
|
BI.each(key, (k, v) => { |
|
self.attr(k, v); |
|
}); |
|
return this; |
|
} |
|
if (BI.isNull(value)) { |
|
return this.attribs[key]; |
|
} |
|
this.attribs[key] = value; |
|
return this; |
|
}); |
|
Element.registerFunction('hasAttrib', function (key) { |
|
return this.attribs[key] != null; |
|
}); |
|
Element.registerFunction('removeAttr', function (key) { |
|
delete this.attribs[key]; |
|
}); |
|
};
|
|
|