mirror of
https://github.com/documize/community.git
synced 2025-08-08 06:55:28 +02:00
lazy load tinymce for faster app boot time
This commit is contained in:
parent
17ad6671c5
commit
6717e4a4ef
3 changed files with 14 additions and 2 deletions
|
@ -75,7 +75,16 @@ export default Ember.Component.extend({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (typeof tinymce === 'undefined') {
|
||||||
|
$.getScript(this.session.appMeta.getBaseUrl("tinymce/tinymce.min.js?v=430"), function() {
|
||||||
|
window.tinymce.dom.Event.domLoaded = true;
|
||||||
|
tinymce.baseURL = "//" + window.location.host + "/tinymce";
|
||||||
|
tinymce.suffix = ".min";
|
||||||
tinymce.init(options);
|
tinymce.init(options);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
tinymce.init(options);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
|
|
|
@ -55,7 +55,6 @@
|
||||||
{{content-for 'body'}}
|
{{content-for 'body'}}
|
||||||
<script src="assets/vendor.js"></script>
|
<script src="assets/vendor.js"></script>
|
||||||
<script src="assets/documize.js"></script>
|
<script src="assets/documize.js"></script>
|
||||||
<script src="tinymce/tinymce.min.js?v=430"></script>
|
|
||||||
<script src="codemirror/lib/codemirror.js"></script>
|
<script src="codemirror/lib/codemirror.js"></script>
|
||||||
<script src="codemirror/mode/meta.js"></script>
|
<script src="codemirror/mode/meta.js"></script>
|
||||||
<script src="codemirror/addon/mode/loadmode.js"></script>
|
<script src="codemirror/addon/mode/loadmode.js"></script>
|
||||||
|
|
|
@ -39,6 +39,10 @@ let AppMeta = BaseModel.extend({
|
||||||
this.set('url', [config.apiHost, config.apiNamespace, ""].join('/'));
|
this.set('url', [config.apiHost, config.apiNamespace, ""].join('/'));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getBaseUrl(endpoint) {
|
||||||
|
return [this.get('host'), endpoint].join('/');
|
||||||
|
},
|
||||||
|
|
||||||
getUrl(endpoint) {
|
getUrl(endpoint) {
|
||||||
return [this.get('host'), this.get('namespace'), endpoint].join('/');
|
return [this.get('host'), this.get('namespace'), endpoint].join('/');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue