@@ -742,7 +742,7 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
742742
743743 if ( cursorMoved ) {
744744 cursor . setSelectedRange ( selectedRange , cursor . hasForwardSelection ( ) ) ;
745- self . emit ( ops . Document . signalCursorMoved , cursor ) ;
745+ eventNotifier . emit ( ops . Document . signalCursorMoved , cursor ) ;
746746 }
747747 } ) ;
748748 } ;
@@ -881,7 +881,6 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
881881 if ( cursor ) {
882882 cursor . removeFromDocument ( ) ;
883883 delete cursors [ memberid ] ;
884- self . emit ( ops . Document . signalCursorRemoved , memberid ) ;
885884 return true ;
886885 }
887886 return false ;
@@ -916,12 +915,13 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
916915 } ;
917916
918917 /**
919- * @param {!string } eventid
920- * @param {* } args
918+ * @param {!Array.<!ops.Operation.Event> } events
921919 * @return {undefined }
922920 */
923- this . emit = function ( eventid , args ) {
924- eventNotifier . emit ( eventid , args ) ;
921+ this . emitEvents = function ( events ) {
922+ events . forEach ( function ( event ) {
923+ eventNotifier . emit ( event . eventid , event . args ) ;
924+ } ) ;
925925 } ;
926926
927927 /**
@@ -976,7 +976,7 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
976976 this . handleStepsInserted = function ( args ) {
977977 stepsTranslator . handleStepsInserted ( args ) ;
978978 // signal not used in webodf, but 3rd-party (NVivo)
979- self . emit ( ops . OdtDocument . signalStepsInserted , args ) ;
979+ eventNotifier . emit ( ops . OdtDocument . signalStepsInserted , args ) ;
980980 } ;
981981
982982 /**
@@ -988,7 +988,7 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
988988 this . handleStepsRemoved = function ( args ) {
989989 stepsTranslator . handleStepsRemoved ( args ) ;
990990 // signal not used in webodf, but 3rd-party (NVivo)
991- self . emit ( ops . OdtDocument . signalStepsRemoved , args ) ;
991+ eventNotifier . emit ( ops . OdtDocument . signalStepsRemoved , args ) ;
992992 } ;
993993
994994 /**
0 commit comments