Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. /**
  2. * Convert html into correct element
  3. * @param html
  4. */
  5. html2element:function(html) {
  6. var $template, attributes = {},
  7. template = html;
  8. $template = $(template(this.model.toJSON()).trim()), _.each($template.get(0).attributes, function(attr) {
  9. attributes[attr.name] = attr.value
  10. }), this.$el.attr(attributes).html($template.html()), this.setContent(), this.renderContent()
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement