discourse/app/assets/javascripts/discourse/widgets/raw-html.js.es6

18 lines
276 B
JavaScript

export default class RawHtml {
constructor(attrs) {
this.html = attrs.html;
}
init() {
return $(this.html)[0];
}
update(prev) {
if (prev.html === this.html) { return; }
return this.init();
}
destroy() { }
}
RawHtml.prototype.type = 'Widget';