fire event when session changes

This commit is contained in:
Fabian Jakobs 2011-01-25 21:36:51 +01:00
commit 383e493fa0

View file

@ -122,6 +122,7 @@ var Editor =function(renderer, session) {
if (this.session == session) return; if (this.session == session) return;
if (this.session) { if (this.session) {
var oldSession = this.session;
this.session.removeEventListener("change", this.$onDocumentChange); this.session.removeEventListener("change", this.$onDocumentChange);
this.session.removeEventListener("changeMode", this.$onDocumentModeChange); this.session.removeEventListener("changeMode", this.$onDocumentModeChange);
this.session.removeEventListener("changeTabSize", this.$onDocumentChangeTabSize); this.session.removeEventListener("changeTabSize", this.$onDocumentChangeTabSize);
@ -172,6 +173,11 @@ var Editor =function(renderer, session) {
this.onDocumentChangeAnnotation(); this.onDocumentChangeAnnotation();
this.renderer.scrollToRow(session.getScrollTopRow()); this.renderer.scrollToRow(session.getScrollTopRow());
this.renderer.updateFull(); this.renderer.updateFull();
this._dispatchEvent("changeSession", {
session: session,
oldSession: oldSession
});
}; };
this.getSession = function() { this.getSession = function() {