From fa1a8b2dde7b68e9000ae4b93c8bda111e38a25d Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Thu, 16 May 2013 02:49:29 -0400 Subject: [PATCH] Fix Drawer event emission Drawer tries to emit events on the parent Viewer object but doesn't have a reference to it. Add a reference when constructing the Drawer. --- src/drawer.js | 1 + src/viewer.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/drawer.js b/src/drawer.js index 60a85890..72c932d5 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -94,6 +94,7 @@ $.Drawer = function( options ) { $.extend( true, this, { //internal state properties + viewer: null, downloading: 0, tilesMatrix: {}, tilesLoaded: [], diff --git a/src/viewer.js b/src/viewer.js index 8be9ec48..6eed9106 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1047,6 +1047,7 @@ function openTileSource( viewer, source ) { _this.source.overlays = _this.source.overlays || []; _this.drawer = new $.Drawer({ + viewer: _this, source: _this.source, viewport: _this.viewport, element: _this.canvas,