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

Commit

Permalink
Merge pull request #96 from ravishivt/master
Browse files Browse the repository at this point in the history
Add API signals for when the editor gets shown and when the popup gets shown
  • Loading branch information
Rainer Simon committed Feb 20, 2014
2 parents 2c4ca35 + 93480ae commit 3235254
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ annotorious.Editor.prototype.open = function(opt_annotation, opt_event) {
goog.dom.appendChild(field.el, f);
}
});
this._annotator.fireEvent(annotorious.events.EventType.ANNOTATION_EDITOR_SHOWN, opt_annotation);
}

/**
Expand Down
12 changes: 11 additions & 1 deletion src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ annotorious.events.EventType = {
/**
* An existing annotation was updated
*/
ANNOTATION_UPDATED: 'onAnnotationUpdated'
ANNOTATION_UPDATED: 'onAnnotationUpdated',

/**
* The annotation editor was opened. Pass the annotation object if it exists.
*/
ANNOTATION_EDITOR_SHOWN: 'onAnnotationEditorShown',

/**
* The annotation popop was opened. Pass the annotation object.
*/
ANNOTATION_POPUP_SHOWN: 'onAnnotationPopupShown'

};
1 change: 1 addition & 0 deletions src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ annotorious.Popup.prototype.show = function(annotation, xy) {

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

/**
Expand Down

0 comments on commit 3235254

Please sign in to comment.