mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 12:02:05 +08:00
DEV: s/Em/Ember (#6874)
This commit is contained in:
@ -55,7 +55,7 @@ export default Ember.Component.extend(
|
||||
if (this.get("isUploading")) {
|
||||
this.resumable.cancel();
|
||||
var self = this;
|
||||
Em.run.later(function() {
|
||||
Ember.run.later(function() {
|
||||
self._reset();
|
||||
});
|
||||
return false;
|
||||
@ -83,20 +83,20 @@ export default Ember.Component.extend(
|
||||
// automatically upload the selected file
|
||||
self.resumable.upload();
|
||||
// mark as uploading
|
||||
Em.run.later(function() {
|
||||
Ember.run.later(function() {
|
||||
self.set("isUploading", true);
|
||||
});
|
||||
});
|
||||
|
||||
this.resumable.on("fileProgress", function(file) {
|
||||
// update progress
|
||||
Em.run.later(function() {
|
||||
Ember.run.later(function() {
|
||||
self.set("progress", parseInt(file.progress() * 100, 10));
|
||||
});
|
||||
});
|
||||
|
||||
this.resumable.on("fileSuccess", function(file) {
|
||||
Em.run.later(function() {
|
||||
Ember.run.later(function() {
|
||||
// mark as not uploading anymore
|
||||
self._reset();
|
||||
// fire an event to allow the parent route to reload its model
|
||||
@ -105,7 +105,7 @@ export default Ember.Component.extend(
|
||||
});
|
||||
|
||||
this.resumable.on("fileError", function(file, message) {
|
||||
Em.run.later(function() {
|
||||
Ember.run.later(function() {
|
||||
// mark as not uploading anymore
|
||||
self._reset();
|
||||
// fire an event to allow the parent route to display the error message
|
||||
@ -116,7 +116,7 @@ export default Ember.Component.extend(
|
||||
|
||||
_assignBrowse: function() {
|
||||
var self = this;
|
||||
Em.run.schedule("afterRender", function() {
|
||||
Ember.run.schedule("afterRender", function() {
|
||||
self.resumable.assignBrowse(self.$());
|
||||
});
|
||||
}.on("didInsertElement"),
|
||||
|
Reference in New Issue
Block a user