[Code Style] Use prototypes in representation bundle

WTD-1482
This commit is contained in:
Victor Woeltjen
2015-08-14 16:10:41 -07:00
parent 07a2065c11
commit 365134b085
7 changed files with 216 additions and 192 deletions

View File

@@ -32,7 +32,7 @@ define(
/**
* A DropGesture adds and maintains event handlers upon an element
* such that it may act as a drop target for drag-drop composition.
*
* @memberof platform/representation
* @constructor
* @param $q Angular's $q, for promise handling
@@ -40,7 +40,6 @@ define(
* @param {DomainObject} domainObject the domain object whose
* composition should be modified as a result of the drop.
*/
function DropGesture(dndService, $q, element, domainObject) {
var actionCapability = domainObject.getCapability('action'),
action; // Action for the drop, when it occurs
@@ -122,19 +121,16 @@ define(
element.on('drop', drop);
}
return {
/**
* Detach any event handlers associated with this gesture.
* @memberof platform/representation.DropGesture#
*/
destroy: function () {
element.off('dragover', dragOver);
element.off('drop', drop);
}
};
this.element = element;
this.dragOverCallback = dragOver;
this.dropCallback = drop;
}
DropGesture.prototype.destroy = function () {
this.element.off('dragover', this.dragOverCallback);
this.element.off('drop', this.dropCallback);
};
return DropGesture;
}