From f8582fce5d43128c964f3f4e171b046cfb4555b4 Mon Sep 17 00:00:00 2001 From: Cory Forsyth Date: Tue, 26 Apr 2016 14:55:41 -0400 Subject: [PATCH] enable logging in demo app --- demo/app/controllers/index.js | 12 +++++++++++- demo/app/templates/index.hbs | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/demo/app/controllers/index.js b/demo/app/controllers/index.js index 46d90716b..3fcd228aa 100644 --- a/demo/app/controllers/index.js +++ b/demo/app/controllers/index.js @@ -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(); @@ -30,5 +36,9 @@ export default Ember.Controller.extend({ didEdit(value) { this.set('editedMobiledoc', value); } + }, + + enableLogging(editor) { + editor.enableLogging(); } }); diff --git a/demo/app/templates/index.hbs b/demo/app/templates/index.hbs index 26a51df23..7f151469c 100644 --- a/demo/app/templates/index.hbs +++ b/demo/app/templates/index.hbs @@ -38,6 +38,7 @@ cards=(mobiledoc-cards-list) atoms=(mobiledoc-atoms-list) on-change=(action 'didEdit') + did-create-editor=(action 'didCreateEditor') as |editor|}} {{mobiledoc-toolbar editor=editor}}