Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mobiledoc-kit's AMD build #51

Merged
merged 1 commit into from
Jan 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions addon/components/mobiledoc-editor/component.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global Mobiledoc */
import Ember from 'ember';
import layout from './template';

import Editor from 'mobiledoc-kit/editor/editor';
import Range from 'mobiledoc-kit/utils/cursor/range';
let { computed, Component } = Ember;
let { capitalize, camelize } = Ember.String;

Expand All @@ -13,9 +13,6 @@ const EMPTY_MOBILEDOC = {
sections: [[], []]
};

const MobiledocEditor = Mobiledoc.Editor;
const MobiledocRange = Mobiledoc.Range;

function arrayToMap(array, propertyName) {
let map = Object.create(null);
array.forEach(item => {
Expand Down Expand Up @@ -212,7 +209,7 @@ export default Component.extend({
this.get('componentCards').removeObject(card);
}
};
editor = new MobiledocEditor(editorOptions);
editor = new Editor(editorOptions);
editor.willRender(() => {
// The editor's render/rerender will happen after this `editor.willRender`,
// so we explicitly start a runloop here if there is none, so that the
Expand Down Expand Up @@ -295,7 +292,7 @@ export default Component.extend({
// This prevents problems with the editor element being out-of-focus
// but the window's selection still in the editor element.
// See https://github.com/bustlelabs/mobiledoc-kit/issues/286
let range = new MobiledocRange(card.tailPosition());
let range = new Range(card.tailPosition());
postEditor.setRange(range);
});
}
Expand Down
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module.exports = {
files.push(new Funnel(distDirFor('mobiledoc-kit'), {
files: [
'css/mobiledoc-kit.css',
'global/mobiledoc-kit.js',
'global/mobiledoc-kit.map'
'amd/mobiledoc-kit.js',
'amd/mobiledoc-kit.map'
],
destDir: 'mobiledoc-kit'
}));
Expand All @@ -32,7 +32,7 @@ module.exports = {
if (rendererDir) {
files.push(new Funnel(rendererDir, {
files: [
'global/mobiledoc-dom-renderer.js'
'amd/mobiledoc-dom-renderer.js'
],
destDir: 'mobiledoc-dom-renderer'
}));
Expand All @@ -43,10 +43,10 @@ module.exports = {

included: function(app) {
app.import('vendor/mobiledoc-kit/css/mobiledoc-kit.css');
app.import('vendor/mobiledoc-kit/global/mobiledoc-kit.js');
app.import('vendor/mobiledoc-kit/amd/mobiledoc-kit.js');
var rendererDir = distDirFor('mobiledoc-dom-renderer');
if (rendererDir) {
app.import('vendor/mobiledoc-dom-renderer/global/mobiledoc-dom-renderer.js');
app.import('vendor/mobiledoc-dom-renderer/amd/mobiledoc-dom-renderer.js');
}
}
};
2 changes: 1 addition & 1 deletion tests/unit/utils/create-component-card-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global MobiledocDOMRenderer */
import createComponentCard from 'ember-mobiledoc-editor/utils/create-component-card';
import { module, test } from 'qunit';
import MobiledocDOMRenderer from 'mobiledoc-dom-renderer';

module('Unit | Utility | create component card');

Expand Down