mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
Replace deprecated render(buffer)
with a custom buffered renderer
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
|
||||
/*global Resumable:true */
|
||||
|
||||
/**
|
||||
@ -10,7 +12,7 @@
|
||||
uploadText="UPLOAD"
|
||||
}}
|
||||
**/
|
||||
const ResumableUploadComponent = Ember.Component.extend(Discourse.StringBuffer, {
|
||||
export default Ember.Component.extend(bufferedRender({
|
||||
tagName: "button",
|
||||
classNames: ["btn", "ru"],
|
||||
classNameBindings: ["isUploading"],
|
||||
@ -36,9 +38,9 @@ const ResumableUploadComponent = Ember.Component.extend(Discourse.StringBuffer,
|
||||
}
|
||||
}.property("isUploading", "progress"),
|
||||
|
||||
renderString: function(buffer) {
|
||||
var icon = this.get("isUploading") ? "times" : "upload";
|
||||
buffer.push("<i class='fa fa-" + icon + "'></i>");
|
||||
buildBuffer(buffer) {
|
||||
const icon = this.get("isUploading") ? "times" : "upload";
|
||||
buffer.push(`<i class="fa fa-${icon}"></i>`);
|
||||
buffer.push("<span class='ru-label'>" + this.get("text") + "</span>");
|
||||
buffer.push("<span class='ru-progress' style='width:" + this.get("progress") + "%'></span>");
|
||||
},
|
||||
@ -117,6 +119,4 @@ const ResumableUploadComponent = Ember.Component.extend(Discourse.StringBuffer,
|
||||
}
|
||||
}.on("willDestroyElement")
|
||||
|
||||
});
|
||||
|
||||
export default ResumableUploadComponent;
|
||||
}));
|
||||
|
Reference in New Issue
Block a user