Last active
January 31, 2017 05:04
-
-
Save graham-sportsmgmt/59ebbf80a9e557b526d213cc9ec88693 to your computer and use it in GitHub Desktop.
Ember JSignature Components
This file contains hidden or 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.Component.extend({ | |
format: null, | |
didInsertElement: function () { | |
this._super(...arguments); | |
jQuery('#' + this.get('elementId') + ' > #signature').jSignature(); | |
}, | |
// clean up to prevent memory leaks | |
willDestroyElement: function () { | |
this._super(...arguments); | |
}, | |
actions: { | |
accept() { | |
this.get('onAccept')(jQuery('#' + this.get('elementId') + ' > #signature').jSignature('getData', this.get('format'))); | |
}, | |
clear() { | |
jQuery('#' + this.get('elementId') + ' > #signature').jSignature('clear'); | |
} | |
} | |
}); |
This file contains hidden or 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({ | |
appName: 'Ember JSignature Demo', | |
mySignature: null, | |
actions: { | |
onAccept: function(signature) { | |
this.set('mySignature', signature); | |
} | |
} | |
}); |
This file contains hidden or 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
{ | |
"version": "0.11.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js", | |
"ember": "2.10.2", | |
"ember-data": "2.11.0", | |
"ember-template-compiler": "2.10.2", | |
"ember-testing": "2.10.2", | |
"bootstrap": "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css", | |
"bootstrap-js": "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js", | |
"jsignature": "https://rawgit.com/willowsystems/jSignature/master/libs/jSignature.min.js" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment