FIX: Allow loadScript to use script tags if the JS library require it.

This commit is contained in:
Robin Ward
2015-03-12 13:09:17 -04:00
parent 69851bc6cf
commit 3ecb58980f
2 changed files with 30 additions and 12 deletions

View File

@ -32,15 +32,7 @@ export default Ember.Component.extend({
_initEditor: function() {
const self = this;
loadScript("/javascripts/ace/ace.js").then(function() {
// this is a bit weird, unlike $LAB loadScript is not keeping
// relative directory which messes stuff up
// TODO: correct relative directory and get rid of this
_.each(["base","mode","theme","worker"], function(p){
ace.config.set(p +"Path", "/javascripts/ace");
});
loadScript("/javascripts/ace/ace.js", { scriptTag: true }).then(function() {
const editor = ace.edit(self.$('.ace')[0]);
editor.setTheme("ace/theme/chrome");