diff --git a/components/active/init.js b/components/active/init.js index 6ad3440..7269a96 100755 --- a/components/active/init.js +++ b/components/active/init.js @@ -399,19 +399,21 @@ this.highlightEntry(path, moveToTabList); if(path != this.getPath()) { + codiad.editor.setSession(this.sessions[path]); this.history.push(path); - $.get(this.controller, {'action':'focused', 'path':path}); + $.get(this.controller, {'action':'focused', 'path':path}, function() { + + if( ! ( this.positions[`${path}`] === undefined ) ) { + + this.setPosition( this.positions[`${path}`] ); + } + }); } /* Check for users registered on the file. */ this.check(path); - if( ! ( this.positions[`${path}`] === undefined ) ) { - - this.setPosition( this.positions[`${path}`] ); - } - /* Notify listeners. */ amplify.publish('active.onFocus', path); },