Last active
March 11, 2017 15:25
-
-
Save cs3b/fdfd0fc865a487ef53de5882e5b2c6e5 to your computer and use it in GitHub Desktop.
PaperPickaday for ember-paper
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'; | |
| import PikadayMixin from 'ember-pikaday/mixins/pikaday'; | |
| import PaperInput from 'ember-paper/components/paper-input'; | |
| import layout from 'ember-paper/templates/components/paper-input'; | |
| export default PaperInput.extend(PikadayMixin, { | |
| layout, | |
| didInsertElement() { | |
| this._super(...arguments); | |
| this.set('field', this.element.children[1]); | |
| this.setupPikaday(); | |
| }, | |
| onPikadayOpen() { | |
| this.get('onOpen')(); | |
| }, | |
| onPikadayClose() { | |
| if (this.get('pikaday').getDate() === null || Ember.isEmpty(this.$(this.field).val())) { | |
| this.set('value', null); | |
| this.get('onSelection')(null); | |
| } | |
| this.get('onChange')(this.field.value); | |
| } | |
| }); |
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: 'paper-pickaday demo for ember-paper', | |
| changeset: { | |
| documentDateOn: '2017-03-11' | |
| } | |
| }); |
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.1", | |
| "EmberENV": { | |
| "FEATURES": {} | |
| }, | |
| "options": { | |
| "use_pods": false, | |
| "enable-testing": false | |
| }, | |
| "dependencies": { | |
| "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
| "ember": "2.11.0", | |
| "ember-data": "2.11.0", | |
| "ember-template-compiler": "2.11.0", | |
| "ember-testing": "2.11.0", | |
| "ember-paper": "1.0.0-alpha.18", | |
| "ember-pikaday": "2.2.1" | |
| }, | |
| "addons": {} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment