Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-04-05 12:46:19 +0300
committerPhil Hughes <me@iamphill.com>2018-04-05 18:00:18 +0300
commit299aad3d511e155878bea64797afc37d244506d5 (patch)
treec9ea436e3a980c9f101f47431525665fb6193868 /app/assets/javascripts/ide/lib
parent26901470ae8af7d4911843b6de92a6110cb71fe4 (diff)
fixed staged content not updating
Diffstat (limited to 'app/assets/javascripts/ide/lib')
-rw-r--r--app/assets/javascripts/ide/lib/common/model.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/assets/javascripts/ide/lib/common/model.js b/app/assets/javascripts/ide/lib/common/model.js
index 1475d6b9ce0..31987c7aa32 100644
--- a/app/assets/javascripts/ide/lib/common/model.js
+++ b/app/assets/javascripts/ide/lib/common/model.js
@@ -34,10 +34,12 @@ export default class Model {
this.events = new Map();
this.updateContent = this.updateContent.bind(this);
+ this.updateNewContent = this.updateNewContent.bind(this);
this.dispose = this.dispose.bind(this);
eventHub.$on(`editor.update.model.dispose.${this.file.key}`, this.dispose);
eventHub.$on(`editor.update.model.content.${this.file.key}`, this.updateContent);
+ eventHub.$on(`editor.update.model.new.content.${this.file.key}`, this.updateNewContent);
}
get url() {
@@ -87,11 +89,16 @@ export default class Model {
}
}
+ updateNewContent(content) {
+ this.getModel().setValue(content);
+ }
+
dispose() {
this.disposable.dispose();
this.events.clear();
eventHub.$off(`editor.update.model.dispose.${this.file.key}`, this.dispose);
eventHub.$off(`editor.update.model.content.${this.file.key}`, this.updateContent);
+ eventHub.$off(`editor.update.model.new.content.${this.file.key}`, this.updateNewContent);
}
}