-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed all the secondary functionality such as: - Browser events - Enabling/Disabling pan/zoom events - Control icons - Double click - Mousewheel zoom - Min/max zoom - fix/contain/center Removed functionality will be moved into plugins or as easy to implement examples. Browser events (click, mousemove...) will be moved into a plugin. The same goes for mousewheel. Everything will be around events. Some of them will have alterable event data. Related to #98
- Loading branch information
Showing
4 changed files
with
173 additions
and
578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
var Utils = require('./utilities') | ||
; | ||
|
||
var SvgPanZoomEvent = { | ||
/** | ||
* Original event | ||
* | ||
* @type {Event|Object|null} | ||
*/ | ||
originalEvent: null | ||
|
||
/** | ||
* Event data | ||
* | ||
* @type {Object|null} | ||
*/ | ||
, data: null | ||
|
||
/** | ||
* Event propagation allowance through middlewares | ||
* | ||
* @type {Boolean} | ||
* @default true | ||
*/ | ||
, isPropagating: true | ||
|
||
/** | ||
* Should the event be prevented from default (core) action | ||
* | ||
* @type {Boolean} | ||
* @default false | ||
*/ | ||
, isPrevented: false | ||
|
||
/** | ||
* Stops event propagation | ||
*/ | ||
, stopPropagation: function() { | ||
this.isPropagating = false | ||
this.isPrevented = true | ||
} | ||
|
||
/** | ||
* Prevents default (core) action | ||
*/ | ||
, preventDefault: function() { | ||
this.isPrevented = true | ||
} | ||
|
||
/** | ||
* Stops event propagation but doesn't prevent default (core) action | ||
*/ | ||
, passThrough: function() { | ||
this.isPropagating = false | ||
} | ||
} | ||
|
||
module.exports = { | ||
create: function(data, originalEvent) { | ||
var event = Object.create(SvgPanZoomEvent) | ||
|
||
// Add data attributes | ||
data != null && (event.data = data) | ||
originalEvent != null && (event.originalEvent = originalEvent) | ||
|
||
return event | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.