@@ -739,7 +739,7 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
739739
740740 if ( cursorMoved ) {
741741 cursor . setSelectedRange ( selectedRange , cursor . hasForwardSelection ( ) ) ;
742- self . emit ( ops . Document . signalCursorMoved , cursor ) ;
742+ eventNotifier . emit ( ops . Document . signalCursorMoved , cursor ) ;
743743 }
744744 } ) ;
745745 } ;
@@ -878,7 +878,6 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
878878 if ( cursor ) {
879879 cursor . removeFromDocument ( ) ;
880880 delete cursors [ memberid ] ;
881- self . emit ( ops . Document . signalCursorRemoved , memberid ) ;
882881 return true ;
883882 }
884883 return false ;
@@ -913,12 +912,13 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
913912 } ;
914913
915914 /**
916- * @param {!string } eventid
917- * @param {* } args
915+ * @param {!Array.<!ops.Operation.Event> } events
918916 * @return {undefined }
919917 */
920- this . emit = function ( eventid , args ) {
921- eventNotifier . emit ( eventid , args ) ;
918+ this . emitEvents = function ( events ) {
919+ events . forEach ( function ( event ) {
920+ eventNotifier . emit ( event . eventid , event . args ) ;
921+ } ) ;
922922 } ;
923923
924924 /**
@@ -973,7 +973,7 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
973973 this . handleStepsInserted = function ( args ) {
974974 stepsTranslator . handleStepsInserted ( args ) ;
975975 // signal not used in webodf, but 3rd-party (NVivo)
976- self . emit ( ops . OdtDocument . signalStepsInserted , args ) ;
976+ eventNotifier . emit ( ops . OdtDocument . signalStepsInserted , args ) ;
977977 } ;
978978
979979 /**
@@ -985,7 +985,7 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
985985 this . handleStepsRemoved = function ( args ) {
986986 stepsTranslator . handleStepsRemoved ( args ) ;
987987 // signal not used in webodf, but 3rd-party (NVivo)
988- self . emit ( ops . OdtDocument . signalStepsRemoved , args ) ;
988+ eventNotifier . emit ( ops . OdtDocument . signalStepsRemoved , args ) ;
989989 } ;
990990
991991 /**
0 commit comments