mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 00:00:49 +00:00
CollabTarget: Pass import promise to setSynchronizer
Depends-On: I188e749c315ddbb5f8779db10987178a51d27f5c Change-Id: I57fe6af459416e039274ea4c360e09a55123b024
This commit is contained in:
parent
862486fe2f
commit
86786bc947
|
@ -118,12 +118,10 @@ ve.init.mw.CollabTarget.prototype.attachToolbar = function () {
|
|||
*/
|
||||
ve.init.mw.CollabTarget.prototype.setSurface = function ( surface ) {
|
||||
var synchronizer, surfaceView, defaultName,
|
||||
importDeferred = $.Deferred(),
|
||||
target = this;
|
||||
|
||||
if ( surface !== this.surface ) {
|
||||
// TODO: Show 'connecting' progress bar until doc is ready
|
||||
surface.getModel().setNullSelection();
|
||||
|
||||
this.$editableContent.after( surface.$element );
|
||||
|
||||
surfaceView = surface.getView();
|
||||
|
@ -169,8 +167,9 @@ ve.init.mw.CollabTarget.prototype.setSurface = function ( surface ) {
|
|||
} );
|
||||
initPromise.always( function () {
|
||||
surface.getModel().selectFirstContentOffset();
|
||||
// TODO: Hide 'connecting' progress bar
|
||||
} ); // TODO: Handle .fail
|
||||
// Resolve progress bar
|
||||
importDeferred.resolve();
|
||||
} );
|
||||
} );
|
||||
|
||||
// TODO: server could communicate with MW (via oauth?) to know the
|
||||
|
@ -184,7 +183,7 @@ ve.init.mw.CollabTarget.prototype.setSurface = function ( surface ) {
|
|||
synchronizer.changeName( defaultName );
|
||||
}
|
||||
|
||||
surfaceView.setSynchronizer( synchronizer );
|
||||
surfaceView.setSynchronizer( synchronizer, importDeferred.promise() );
|
||||
}
|
||||
|
||||
// Parent method
|
||||
|
|
Loading…
Reference in a new issue