Skip to content

Instantly share code, notes, and snippets.

@huiralb
huiralb / composer_view.js
Created October 2, 2016 16:35
Fix Visual Composer 4.8 Uncaught TypeError: Cannot read property 'attributes' of undefined
html2element: function(html) {
var $template, attributes = {},
template = html;
$template = $(template(this.model.toJSON()).trim());
if($template.get(0))
{
_.each($template.get(0).attributes, function(attr) {
attributes[attr.name] = attr.value
})};