mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
FIX: Allow loadScript
to use script tags if the JS library require it.
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user