-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support a toggle for moving between html & WYSIWYG content. 0.1.1 Release
- Loading branch information
Asaf Shakarzy
committed
Feb 24, 2015
1 parent
4699e19
commit f8d1dc6
Showing
8 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Em from 'ember'; | ||
import WithConfigMixin from 'ember-idx-utils/mixin/with-config'; | ||
var computed = Em.computed; | ||
|
||
export default Em.Component.extend(WithConfigMixin, { | ||
tagName: 'a', | ||
layoutName: 'components/em-wysiwyg-action', | ||
classNameBindings: ['styleClasses', 'activeClasses'], | ||
wysiwyg: computed.alias('parentView.wysiwyg'), | ||
editor: computed.alias('wysiwyg.editor'), | ||
//When active, we'r in textarea mode | ||
active: false, | ||
styleClasses: (function() { | ||
var _ref; | ||
return (_ref = this.get('config.wysiwyg.actionClasses')) != null ? _ref.join(" ") : void 0; | ||
}).property(), | ||
activeClasses: (function() { | ||
var _ref; | ||
if (this.get('active')) { | ||
return (_ref = this.get('config.wysiwyg.actionActiveClasses')) != null ? _ref.join(" ") : void 0; | ||
} | ||
}).property('active'), | ||
click: function() { | ||
if (this.get('active')) { | ||
this.set('active', false); | ||
this.set('wysiwyg.editor.display', 'block'); | ||
this.set('wysiwyg.editor-textarea.display', 'none'); | ||
//Copy the content of as_html into data | ||
this.get('editor').$().html(this.get('wysiwyg.as_html')); | ||
} else { | ||
this.set('active', true); | ||
this.set('wysiwyg.editor.display', 'none'); | ||
this.set('wysiwyg.editor-textarea.display', 'block'); | ||
} | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Em from 'ember'; | ||
var computed = Em.computed; | ||
import StyleBindingsMixin from 'ember-idx-utils/mixin/style-bindings'; | ||
|
||
export default Em.TextArea.extend(StyleBindingsMixin, { | ||
styleBindings: ['display', 'width', 'border'], | ||
width: '100%', | ||
border: 'none;', | ||
wysiwyg: computed.alias('parentView'), | ||
value: computed.alias('wysiwyg.as_html'), | ||
display: 'none', | ||
registerInParent: (function() { | ||
this.set('parentView.editor-textarea', this); | ||
}).on('init') | ||
}); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import WysiwygActionTextHtmlToggler from 'ember-idx-wysiwyg/action-text-html-toggler'; | ||
export default WysiwygActionTextHtmlToggler; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import WysiwygEditorAreaComponent from 'ember-idx-wysiwyg/editor-textarea'; | ||
export default WysiwygEditorAreaComponent; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Em from 'ember'; | ||
|
||
export default Em.Controller.extend({ | ||
|
||
}); |
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