|
|
|
@ -890,6 +890,7 @@ const Component = Backbone.Model.extend(Styleable).extend( |
|
|
|
/** |
|
|
|
* Return HTML string of the component |
|
|
|
* @param {Object} [opts={}] Options |
|
|
|
* @param {String} [opts.tag] Custom tagName |
|
|
|
* @param {Object|Function} [opts.attributes=null] You can pass an object of custom attributes to replace |
|
|
|
* with the current one or you can even pass a function to generate attributes dynamically |
|
|
|
* @return {String} HTML string |
|
|
|
@ -918,11 +919,12 @@ const Component = Backbone.Model.extend(Styleable).extend( |
|
|
|
toHTML(opts = {}) { |
|
|
|
const model = this; |
|
|
|
const attrs = []; |
|
|
|
const classes = []; |
|
|
|
const tag = model.get('tagName'); |
|
|
|
const customTag = opts.tag; |
|
|
|
const tag = customTag || model.get('tagName'); |
|
|
|
const sTag = model.get('void'); |
|
|
|
const customAttr = opts.attributes; |
|
|
|
let attributes = this.getAttrToHTML(); |
|
|
|
delete opts.tag; |
|
|
|
|
|
|
|
// Get custom attributes if requested
|
|
|
|
if (customAttr) { |
|
|
|
|