import Ember from 'ember';

export default Ember.Component.extend({
    thumbnail: null,
    actions: {
        uploadImage: function(e) {
            var self = this;

            //var canvas = this.$().find('.img-selector-canvas')[0];
            //var ctx = canvas.getContext('2d');

            var reader = new window.FileReader();
            reader.onload = function(event){
                /*
                var img = new Image();
                img.onload = function(){
                    canvas.width = img.width;
                    canvas.height = img.height;
                    ctx.drawImage(img,0,0);
                };
                img.src = event.target.result;
                 */
                self.set('thumbnail', event.target.result);
                var onSetImage = self.get('onSetImage');
                if (onSetImage) {
                    onSetImage(event.target.result);
                }
            };
            reader.readAsDataURL(e.target.files[0]);
        }
    }
});

@@ -178,532 +178,90 @@
     
-//var canvas = this.$().find('.img-selector-canvas')%5B0%5D;%0A            //var ctx = canvas.getContext('2d');%0A%0A            var reader = new window.FileReader();%0A            reader.onload = function(event)%7B%0A                /*%0A                var img = new Image();%0A                img.onload = function()%7B%0A                    canvas.width = img.width;%0A                    canvas.height = img.height;%0A                    ctx.drawImage(img,0,0);%0A                %7D;%0A                img.src = event.target.result;%0A                 */
+var reader = new window.FileReader();%0A            reader.onload = function(event)%7B
 %0A   

Remove old commented-out code