Skip to content

Commit

Permalink
enable logging in demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
bantic committed Apr 26, 2016
1 parent 019dd58 commit f8582fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion demo/app/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ import Ember from 'ember';

import mobiledocs from '../mobiledocs/index';

const INITIAL_MOBILEDOC = 'simple';

let { $ } = Ember;

export default Ember.Controller.extend({
init() {
this._super.apply(this, arguments);
let mobiledoc = mobiledocs['simple'];
let mobiledoc = mobiledocs[INITIAL_MOBILEDOC];
this.set('mobiledoc', mobiledoc);
this.set('editedMobiledoc', mobiledoc);
this.set('rendererName', 'dom');
},

actions: {
didCreateEditor(editor) {
this.enableLogging(editor);
},

changeMobiledoc() {
let selectElement = $('#select-mobiledoc');
let name = selectElement.val();
Expand All @@ -30,5 +36,9 @@ export default Ember.Controller.extend({
didEdit(value) {
this.set('editedMobiledoc', value);
}
},

enableLogging(editor) {
editor.enableLogging();
}
});
1 change: 1 addition & 0 deletions demo/app/templates/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
cards=(mobiledoc-cards-list)
atoms=(mobiledoc-atoms-list)
on-change=(action 'didEdit')
did-create-editor=(action 'didCreateEditor')
as |editor|}}
<button {{action editor.addCardInEditMode 'image-card'}}>Add image</button>
{{mobiledoc-toolbar editor=editor}}
Expand Down

0 comments on commit f8582fc

Please sign in to comment.