Permalink
Browse files

Show image, once uploaded.

  • Loading branch information...
Michael Aufreiter
Michael Aufreiter committed Mar 26, 2012
1 parent d732c3c commit f7f5b2b81c8c2e2aa99b7691911ce787f78da191
Showing with 23 additions and 11 deletions.
  1. +10 −4 public/javascripts/substance.js
  2. +3 −3 public/javascripts/substance.min.js
  3. +10 −4 src/client/views/node/image.js
@@ -4173,15 +4173,21 @@ s.views.Node.define('/type/image', {
},
onSuccess: function (assembly) {
- // This triggers a node re-render
+
updateNode(this.model, {
url: assembly.results.web_version[1].url,
original_url: assembly.results.print_version[1].url,
dirty: true
});
-
- this.$('.progress-container').hide();
- this.$('.info').show();
+
+ this.img.attr({src: this.model.get('url')});
+
+ this.img[0].onload = _.bind(function() {
+ // Re-render node once ready
+ this.root.document.deselect()
+ this.$('.progress-container').hide();
+ this.$('.info').show();
+ }, this);
},
onError: function (assembly) {

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -47,15 +47,21 @@ s.views.Node.define('/type/image', {
},
onSuccess: function (assembly) {
- // This triggers a node re-render
+
updateNode(this.model, {
url: assembly.results.web_version[1].url,
original_url: assembly.results.print_version[1].url,
dirty: true
});
-
- this.$('.progress-container').hide();
- this.$('.info').show();
+
+ this.img.attr({src: this.model.get('url')});
+
+ this.img[0].onload = _.bind(function() {
+ // Re-render node once ready
+ this.root.document.deselect()
+ this.$('.progress-container').hide();
+ this.$('.info').show();
+ }, this);
},
onError: function (assembly) {

0 comments on commit f7f5b2b

Please sign in to comment.