diff --git a/src/js/includes/Canvas.js b/src/js/includes/Canvas.js index 2bbca78..2265e2d 100644 --- a/src/js/includes/Canvas.js +++ b/src/js/includes/Canvas.js @@ -1,4 +1,5 @@ 'use strict'; + var config = require('./config'); var util = require('./util'); var ApertureHandler = require('./ApertureHandler'); @@ -11,6 +12,11 @@ var ImageDataHandler = require('./ImageDataHandler'); var $document = $(document); +/** + * Canvas is using fabric to create the canvas and initiate it with its initial settings. + * It is also here most of the interaction is taking place. And most files are connected to this file. + * Fe. getDragbars method can be called from most places as the Canvas class is available in most places. + */ var Canvas = fabric.util.createClass(fabric.Canvas, { initialize: function (id) { this.callSuper('initialize', id, { @@ -24,6 +30,8 @@ var Canvas = fabric.util.createClass(fabric.Canvas, { height: 600 }); + // Eventhandler for mouseup events on the whole canvas. + // This should be rewritten a bit to not have that many events after the image has been cropped. this.on('mouse:up', function () { if (this.getImage().__cropped && !this.get3dHandler().isEnabled()) { this.getApertures().setTransparent(false);