diff --git a/src/js/controller/MinimapController.js b/src/js/controller/MinimapController.js index f913db74..5d42053d 100644 --- a/src/js/controller/MinimapController.js +++ b/src/js/controller/MinimapController.js @@ -5,7 +5,7 @@ this.piskelController = piskelController; this.previewController = previewController; this.drawingController = drawingController; - this.container = container; + this.container = container.get(0); this.isClicked = false; this.isVisible = false; @@ -16,14 +16,14 @@ this.minimapEl = document.createElement('DIV'); this.minimapEl.className = 'minimap-crop-frame'; this.minimapEl.style.display = 'none'; - $(this.container).append(this.minimapEl); + this.container.appendChild(this.minimapEl); // Init mouse events - $(this.container).mousedown(this.onMinimapMousedown_.bind(this)); - $('body').mousemove(this.onMinimapMousemove_.bind(this)); - $('body').mouseup(this.onMinimapMouseup_.bind(this)); + this.container.addEventListener('mousedown', this.onMinimapMousedown_.bind(this)); + document.body.addEventListener('mousemove', this.onMinimapMousemove_.bind(this)); + document.body.addEventListener('mouseup', this.onMinimapMouseup_.bind(this)); - $.subscribe(Events.ZOOM_CHANGED, $.proxy(this.renderMinimap_, this)); + $.subscribe(Events.ZOOM_CHANGED, this.renderMinimap_.bind(this)); }; ns.MinimapController.prototype.renderMinimap_ = function () { @@ -40,8 +40,9 @@ var minimapSize = this.getMinimapSize_(); var previewSize = this.getPreviewSize_(); - var containerHeight = this.container.height(); - var containerWidth = this.container.width(); + var containerRect = this.container.getBoundingClientRect(); + var containerHeight = containerRect.height; + var containerWidth = containerRect.width; // offset(x, y) in frame pixels var offset = this.drawingController.getRenderer().getOffset();