Created
September 22, 2014 12:51
-
-
Save ramrrr/03c4bae5399f26399cdb to your computer and use it in GitHub Desktop.
CKEditor
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
| var App = require("core/App"); | |
| module.exports = App.EmailMessageTextArea = Ember.TextArea.extend({ | |
| useMainMessage:function() { | |
| return this.get('target.useMainMessage'); | |
| }.property('target.useMainMessage'), | |
| classNames:['sosDescriptionTextArea','ckeditor'], | |
| mainMessageObserver:function() { | |
| if(this.get('useMainMessage')) { | |
| this.setValue(this.get('target.mainMessage')); | |
| } | |
| }.observes('target.mainMessage'), | |
| valueObserver: function() { | |
| if(this.get('value')==null || this.get('value').trim()==""){ | |
| this.setValue(null); | |
| } else { | |
| this.setValue(this.get('value')); | |
| } | |
| }.observes('value'), | |
| keyDown: function (e) { | |
| this.set('target.useMainMessage',false); | |
| }, | |
| didInsertElement: function () { | |
| if (!this.get('target.messageDescription') && this.get('target.useMainMessage')) { | |
| this.setValue(this.get('target.mainMessage')); | |
| } else { | |
| this.setValue(this.get('target.messageDescription')); | |
| } | |
| }, | |
| setValue: function(value) { | |
| this.set('value',value) | |
| this.set('target.messageDescription',this.get('value')) | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment