fire event when session changes
This commit is contained in:
parent
4e21d9edd8
commit
383e493fa0
1 changed files with 6 additions and 0 deletions
|
|
@ -122,6 +122,7 @@ var Editor =function(renderer, session) {
|
|||
if (this.session == session) return;
|
||||
|
||||
if (this.session) {
|
||||
var oldSession = this.session;
|
||||
this.session.removeEventListener("change", this.$onDocumentChange);
|
||||
this.session.removeEventListener("changeMode", this.$onDocumentModeChange);
|
||||
this.session.removeEventListener("changeTabSize", this.$onDocumentChangeTabSize);
|
||||
|
|
@ -172,6 +173,11 @@ var Editor =function(renderer, session) {
|
|||
this.onDocumentChangeAnnotation();
|
||||
this.renderer.scrollToRow(session.getScrollTopRow());
|
||||
this.renderer.updateFull();
|
||||
|
||||
this._dispatchEvent("changeSession", {
|
||||
session: session,
|
||||
oldSession: oldSession
|
||||
});
|
||||
};
|
||||
|
||||
this.getSession = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue