Created
April 27, 2016 11:52
-
-
Save fr0gs/b9496463d37f509ae03e65bcff65084d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import FileField from 'ember-uploader/file-field'; | |
var AttachmentFileUploadComponent; | |
AttachmentFileUploadComponent = FileField.extend({ | |
multiple: true, | |
attributeBindings: ["capture", "accept"], | |
accept: "accept='image//*'", | |
capture: "camera", | |
changedFiles: Ember.observer('files', function() { | |
var files; | |
files = this.get('files'); | |
if (!Ember.isEmpty(files)) { | |
this.sendAction('filesChanged', files); | |
return this.rerender(); | |
} | |
}) | |
}); | |
export default AttachmentFileUploadComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
actions: { | |
reset: function(){ | |
Ember.$('#file').wrap('<form>').closest('form').get(0).reset(); | |
Ember.$('#file').unwrap(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment