Merge pull request #94 from bgilbert/drawer-events

Fix Drawer event emission
This commit is contained in:
iangilman 2013-05-20 09:30:17 -07:00
commit 096ba80d73
3 changed files with 2 additions and 1 deletions

View File

@ -94,6 +94,7 @@ $.Drawer = function( options ) {
$.extend( true, this, { $.extend( true, this, {
//internal state properties //internal state properties
viewer: null,
downloading: 0, downloading: 0,
tilesMatrix: {}, tilesMatrix: {},
tilesLoaded: [], tilesLoaded: [],

View File

@ -1047,6 +1047,7 @@ function openTileSource( viewer, source ) {
_this.source.overlays = _this.source.overlays || []; _this.source.overlays = _this.source.overlays || [];
_this.drawer = new $.Drawer({ _this.drawer = new $.Drawer({
viewer: _this,
source: _this.source, source: _this.source,
viewport: _this.viewport, viewport: _this.viewport,
element: _this.canvas, element: _this.canvas,

View File

@ -23,7 +23,6 @@
var openHandler = function(eventSender, eventData) { var openHandler = function(eventSender, eventData) {
viewer.removeHandler('open', openHandler); viewer.removeHandler('open', openHandler);
ok(true, 'Open event was sent'); ok(true, 'Open event was sent');
viewer.drawer.viewer = viewer;
viewer.addHandler('tile-drawn', tileDrawnHandler); viewer.addHandler('tile-drawn', tileDrawnHandler);
}; };