Exporting the API.

This commit is contained in:
ahocevar
2012-06-20 19:06:49 +02:00
parent 74d1a06177
commit a36972fd35

View File

@@ -13,6 +13,7 @@ goog.require('goog.style');
*
* @param {!Event} evt
* @return {boolean}
* @export
*/
ol.event.isSingleTouch = function(evt) {
return !!(evt.touches && evt.touches.length == 1);
@@ -23,6 +24,7 @@ ol.event.isSingleTouch = function(evt) {
*
* @param {!Event} evt
* @return {boolean}
* @export
*/
ol.event.isMultiTouch = function(evt) {
return !!(evt.touches && evt.touches.length > 1);
@@ -45,6 +47,7 @@ ol.event.isMultiTouch = function(evt) {
* false.
* @param {Array.<Object>=} opt_sequences Event sequences to register with this
* events instance.
* @export
*/
ol.event.Events = function(object, opt_element, opt_includeXY, opt_sequences) {
@@ -82,6 +85,7 @@ goog.inherits(ol.event.Events, goog.events.EventTarget);
/**
* @return {Object} The object that this instance is bound to.
* @export
*/
ol.event.Events.prototype.getObject = function() {
return this.object_;
@@ -89,6 +93,7 @@ ol.event.Events.prototype.getObject = function() {
/**
* @param {boolean} includeXY
* @export
*/
ol.event.Events.prototype.setIncludeXY = function(includeXY) {
this.includeXY_ = includeXY;
@@ -97,6 +102,7 @@ ol.event.Events.prototype.setIncludeXY = function(includeXY) {
/**
* @return {EventTarget} The element that this instance currently
* listens to browser events on.
* @export
*/
ol.event.Events.prototype.getElement = function() {
return this.element_;
@@ -109,6 +115,7 @@ ol.event.Events.prototype.getElement = function() {
* @param {EventTarget=} opt_element A DOM element to attach
* browser events to. If called without this argument, all browser events
* will be detached from the element they are currently attached to.
* @export
*/
ol.event.Events.prototype.setElement = function(opt_element) {
var t, types = goog.events.EventType;
@@ -152,6 +159,7 @@ ol.event.Events.prototype.setElement = function(opt_element) {
* property.
* @param {boolean=} opt_priority Register the listener as priority listener,
* so it gets executed before other listeners? Default is false.
* @export
*/
ol.event.Events.prototype.register = function(type, listener, opt_scope,
opt_priority) {
@@ -168,6 +176,7 @@ ol.event.Events.prototype.register = function(type, listener, opt_scope,
* @param {Object=} opt_scope The object to bind the context to for the
* listener. If no scope is specified, default is the event's default
* scope.
* @export
*/
ol.event.Events.prototype.unregister = function(type, listener, opt_scope) {
goog.events.unlisten(
@@ -183,6 +192,7 @@ ol.event.Events.prototype.unregister = function(type, listener, opt_scope) {
*
* @return {boolean} The last listener return. If a listener returns false,
* the chain of listeners will stop getting called.
* @export
*/
ol.event.Events.prototype.triggerEvent = function(type, evt) {
var returnValue,
@@ -264,6 +274,7 @@ ol.event.Events.prototype.handleBrowserEvent = function(evt) {
/**
* Destroy this Events instance.
* @export
*/
ol.event.Events.prototype.destroy = function() {
this.setElement();