DEV: Remove buffered render code
The render buffer code is being removed from core, so we need to remove it's usage from this plugin. This change is a refactor only and should not break any functionality.
This commit is contained in:
parent
86516dadbb
commit
45fbba08fc
|
@ -1,24 +1,6 @@
|
|||
import { on, observes } from "ember-addons/ember-computed-decorators";
|
||||
import debounce from "discourse/lib/debounce";
|
||||
import highlightSyntax from "discourse/lib/highlight-syntax";
|
||||
import { bufferedRender } from "discourse-common/lib/buffered-render";
|
||||
|
||||
export default Ember.Component.extend(
|
||||
bufferedRender({
|
||||
buildBuffer(buffer) {
|
||||
buffer.push("<pre><code class='" + this.codeClass + "'>");
|
||||
buffer.push(Handlebars.Utils.escapeExpression(this.value));
|
||||
buffer.push("</code></pre>");
|
||||
},
|
||||
|
||||
@observes("value")
|
||||
_refreshHighlight: debounce(function() {
|
||||
this.rerenderBuffer();
|
||||
}, 50),
|
||||
|
||||
@on("didInsertElement")
|
||||
_applyHighlight() {
|
||||
highlightSyntax($(this.element));
|
||||
}
|
||||
})
|
||||
);
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<pre><code class={{codeClass}}>{{value}}</code></pre>
|
Loading…
Reference in New Issue