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

Revert "#193 added removeHandler method" #196

Merged
merged 4 commits into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
To Do:
1. removeHandler https://github.com/annotorious/annotorious/issues/193
2. displacement of annotation in chrome
3. circular annotation - https://github.com/annotorious/annotorious/issues/55
4. Drawing a polygon using annotorious - update this in gitter openseadragon
6. Adding custom annotations on OpenSeadragon module

# Annotorious - Image Annotation for the Web

**CURRENTLY UNSUPPORTED**
Expand Down
6 changes: 3 additions & 3 deletions src/mediatypes/annotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ annotorious.mediatypes.Annotator.prototype.addHandler = function(type, handler)
this._eventBroker.addHandler(type, handler);
}

annotorious.mediatypes.Annotator.prototype.removeHandler = function(type) {
this._eventBroker.removeHandler(type);
}
-annotorious.mediatypes.Annotator.prototype.removeHandler = function(type) {
- this._eventBroker.removeHandler(type);
-}

annotorious.mediatypes.Annotator.prototype.fireEvent = function(type, event, opt_extra) {
return this._eventBroker.fireEvent(type, event, opt_extra);
Expand Down
32 changes: 16 additions & 16 deletions src/mediatypes/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,22 +311,22 @@ annotorious.mediatypes.Module.prototype.addHandler = function(type, handler) {
}

/**
* Removes a/all lifecycle event handler/s to this module.
* @param {annotorious.events.EventType} type the event type
* @param {Function} handler the handler function (optional)
*/
annotorious.mediatypes.Module.prototype.removeHandler = function(type, handler) {
goog.array.forEach(this._annotators.getValues(), function(annotator, idx, array) {
annotator.removeHandler(type, handler);
});
goog.array.forEach(this._eventHandlers, function(elem, index, array) {
if(elem.type === type) {
if(!handler || elem.handler === handler) {
goog.array.removeAt(array, index);
}
}
});
}
- * Removes a/all lifecycle event handler/s to this module.
- * @param {annotorious.events.EventType} type the event type
- * @param {Function} handler the handler function (optional)
- */
-annotorious.mediatypes.Module.prototype.removeHandler = function(type, handler) {
- goog.array.forEach(this._annotators.getValues(), function(annotator, idx, array) {
- annotator.removeHandler(type, handler);
- });
- goog.array.forEach(this._eventHandlers, function(elem, index, array) {
- if(elem.type === type) {
- if(!handler || elem.handler === handler) {
- goog.array.removeAt(array, index);
- }
- }
- });
-}

/**
* Adds a plugin to this module.
Expand Down
8 changes: 6 additions & 2 deletions src/mediatypes/openseadragon/openseadragon.annotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ annotorious.mediatypes.openseadragon.OpenSeadragonAnnotator.prototype.editAnnota
}

annotorious.mediatypes.openseadragon.OpenSeadragonAnnotator.prototype.fromItemCoordinates = function(itemCoords) {
var offset = annotorious.dom.getOffset(this.element);
var offset = annotorious.dom.getOffset(this.element);
offset.top += window.pageYOffset;
offset.left += window.pageXOffset;

var viewportPoint = new OpenSeadragon.Point(itemCoords.x, itemCoords.y);
var viewportOpposite = (itemCoords.width) ? new OpenSeadragon.Point(itemCoords.x + itemCoords.width, itemCoords.y + itemCoords.height) : false;
Expand Down Expand Up @@ -191,7 +193,9 @@ annotorious.mediatypes.openseadragon.OpenSeadragonAnnotator.prototype.getActiveS


annotorious.mediatypes.openseadragon.OpenSeadragonAnnotator.prototype.toItemCoordinates = function(xy) {
var offset = annotorious.dom.getOffset(this.element);
var offset = annotorious.dom.getOffset(this.element);
offset.top += window.pageYOffset;
offset.left += window.pageXOffset;

var viewportPoint = new OpenSeadragon.Point(xy.x + offset.left, xy.y + offset.top);
var viewportOpposite = (xy.width) ? new OpenSeadragon.Point(xy.x + offset.left + xy.width - 2, xy.y + offset.top + xy.height - 2) : false;
Expand Down
67 changes: 0 additions & 67 deletions user-specific-annotation-plugin.js

This file was deleted.