diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-06-08 07:53:45 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-06-08 07:53:45 +0300 |
commit | 15993df1d6849bd487855cf4926e2e01e44e54df (patch) | |
tree | 4fdeb8bb4d213bfce9c9abc6cb100996c9621c46 /app/assets/javascripts | |
parent | 2729205b391c22eb3a15408580261456cc030530 (diff) |
remove need to pass monaco around through DI
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/ide/lib/common/model.js | 3 | ||||
-rw-r--r-- | app/assets/javascripts/ide/lib/common/model_manager.js | 5 | ||||
-rw-r--r-- | app/assets/javascripts/ide/lib/editor.js | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/ide/lib/common/model.js b/app/assets/javascripts/ide/lib/common/model.js index ecacc11d77c..a1940321acf 100644 --- a/app/assets/javascripts/ide/lib/common/model.js +++ b/app/assets/javascripts/ide/lib/common/model.js @@ -1,8 +1,9 @@ +import * as monaco from 'monaco-editor'; import Disposable from './disposable'; import eventHub from '../../eventhub'; export default class Model { - constructor(monaco, file, head = null) { + constructor(file, head = null) { this.monaco = monaco; this.disposable = new Disposable(); this.file = file; diff --git a/app/assets/javascripts/ide/lib/common/model_manager.js b/app/assets/javascripts/ide/lib/common/model_manager.js index 7f643969480..bd9b8fc3fcc 100644 --- a/app/assets/javascripts/ide/lib/common/model_manager.js +++ b/app/assets/javascripts/ide/lib/common/model_manager.js @@ -3,8 +3,7 @@ import Disposable from './disposable'; import Model from './model'; export default class ModelManager { - constructor(monaco) { - this.monaco = monaco; + constructor() { this.disposable = new Disposable(); this.models = new Map(); } @@ -22,7 +21,7 @@ export default class ModelManager { return this.getModel(file.key); } - const model = new Model(this.monaco, file, head); + const model = new Model(file, head); this.models.set(model.path, model); this.disposable.add(model); diff --git a/app/assets/javascripts/ide/lib/editor.js b/app/assets/javascripts/ide/lib/editor.js index 3d336fe63f6..30254b25c1e 100644 --- a/app/assets/javascripts/ide/lib/editor.js +++ b/app/assets/javascripts/ide/lib/editor.js @@ -31,7 +31,7 @@ export default class Editor { this.instance = null; this.dirtyDiffController = null; this.disposable = new Disposable(); - this.modelManager = new ModelManager(this.monaco); + this.modelManager = new ModelManager(); this.decorationsController = new DecorationsController(this); this.setupMonacoTheme(); |