@@ -737,7 +737,7 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
737737
738738 if ( cursorMoved ) {
739739 cursor . setSelectedRange ( selectedRange , cursor . hasForwardSelection ( ) ) ;
740- self . emit ( ops . Document . signalCursorMoved , cursor ) ;
740+ eventNotifier . emit ( ops . Document . signalCursorMoved , cursor ) ;
741741 }
742742 } ) ;
743743 } ;
@@ -876,7 +876,6 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
876876 if ( cursor ) {
877877 cursor . removeFromDocument ( ) ;
878878 delete cursors [ memberid ] ;
879- self . emit ( ops . Document . signalCursorRemoved , memberid ) ;
880879 return true ;
881880 }
882881 return false ;
@@ -911,12 +910,13 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
911910 } ;
912911
913912 /**
914- * @param {!string } eventid
915- * @param {* } args
913+ * @param {!Array.<!ops.Operation.Event> } events
916914 * @return {undefined }
917915 */
918- this . emit = function ( eventid , args ) {
919- eventNotifier . emit ( eventid , args ) ;
916+ this . emitEvents = function ( events ) {
917+ events . forEach ( function ( event ) {
918+ eventNotifier . emit ( event . eventid , event . args ) ;
919+ } ) ;
920920 } ;
921921
922922 /**
@@ -971,7 +971,7 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
971971 this . handleStepsInserted = function ( args ) {
972972 stepsTranslator . handleStepsInserted ( args ) ;
973973 // signal not used in webodf, but 3rd-party (NVivo)
974- self . emit ( ops . OdtDocument . signalStepsInserted , args ) ;
974+ eventNotifier . emit ( ops . OdtDocument . signalStepsInserted , args ) ;
975975 } ;
976976
977977 /**
@@ -983,7 +983,7 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
983983 this . handleStepsRemoved = function ( args ) {
984984 stepsTranslator . handleStepsRemoved ( args ) ;
985985 // signal not used in webodf, but 3rd-party (NVivo)
986- self . emit ( ops . OdtDocument . signalStepsRemoved , args ) ;
986+ eventNotifier . emit ( ops . OdtDocument . signalStepsRemoved , args ) ;
987987 } ;
988988
989989 /**
0 commit comments