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
| /** | |
| * Set N latest non visible messages to visible. | |
| */ | |
| revealLastNmessages: function() { | |
| let hiddenMessages = this.get('store').peekAll('chat-message').filterBy('isVisible', false); | |
| let l = hiddenMessages.get('length'); | |
| // Show latest N messages. | |
| hiddenMessages.slice(l - MAX_MESSAGES_COUNT, l) | |
| .setEach('isVisible', true); |
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 Twiddle', | |
| }); |
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'; | |
| const { Service, inject, run } = Ember; | |
| const TWO_HOURS = 2 * 60 * 60 * 1000; | |
| const TWO_DAYS = 2 * 24 * 60 * 60 * 1000; | |
| /** | |
| * Ticking clock service. | |
| * We use this service to sync all our momentjs udpates every second |
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 Twiddle' | |
| }); |
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'; | |
| const { Service, inject, run } = Ember; | |
| const TWO_HOURS = 2 * 60 * 60 * 1000; | |
| const TWO_DAYS = 2 * 24 * 60 * 60 * 1000; | |
| /** | |
| * Ticking clock service. | |
| * We use this service to sync all our momentjs udpates every second |
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
| export default Component.extend({ | |
| tagName: 'time', | |
| tick: function() { | |
| this.nextTick = run.later(this, function() { | |
| this.notifyPropertyChange('timeago'); | |
| this.tick(); | |
| }, 1000); | |
| }.on('init'), |
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
| // The other user we are chatting with. | |
| otherUser: function() { | |
| console.log('HELLO WORLD'); | |
| return this.get('store').peekRecord('user', 'other'); | |
| }.property(), | |
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.Route.extend({ | |
| actions: { | |
| loading(transition, originRoute) { | |
| console.log('XXXXX Loading! XXXXX'); | |
| }, | |
| }, | |
| }); |