Skip to content
This repository was archived by the owner on Apr 2, 2023. It is now read-only.

Commit 93480ae

Browse files
committed
Added API signal that triggers when the Popup gets opened.
1 parent e82a30d commit 93480ae

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ annotorious.Editor.prototype.open = function(opt_annotation, opt_event) {
115115
goog.dom.appendChild(field.el, f);
116116
}
117117
});
118-
this._annotator.fireEvent(annotorious.events.EventType.ANNOTATION_EDIT, opt_annotation);
118+
this._annotator.fireEvent(annotorious.events.EventType.ANNOTATION_EDITOR_SHOWN, opt_annotation);
119119
}
120120

121121
/**

src/events.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ annotorious.events.EventType = {
134134
/**
135135
* The annotation editor was opened. Pass the annotation object if it exists.
136136
*/
137-
ANNOTATION_EDIT: 'onAnnotationEdit'
137+
ANNOTATION_EDITOR_SHOWN: 'onAnnotationEditorShown',
138+
139+
/**
140+
* The annotation popop was opened. Pass the annotation object.
141+
*/
142+
ANNOTATION_POPUP_SHOWN: 'onAnnotationPopupShown'
138143

139144
};

src/popup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ annotorious.Popup.prototype.show = function(annotation, xy) {
175175

176176
goog.style.setOpacity(this.element, 0.9);
177177
goog.style.setStyle(this.element, 'pointer-events', 'auto');
178+
this._annotator.fireEvent(annotorious.events.EventType.ANNOTATION_POPUP_SHOWN, annotation);
178179
}
179180

180181
/**

0 commit comments

Comments
 (0)