define('draw/click-bind', ['core/core', 'draw/core'], function(NIRS, draw) {
    $(function() {
        var DEFAULT_DRAW_TYPE = 'Rect',
            _drawType = DEFAULT_DRAW_TYPE, // type of Object for drawing
            tools__item = $('.tools__item'),
            canvas = new fabric.Canvas('canvas');

        NIRS.on('set-draw-type', function(drawType) {

            if (drawType === 'Move') {
                canvas.selection = true;
            } else {
                canvas.selection = false;
            }

            _drawType = drawType;
        });

        NIRS.getDrawType = function() {
            return _drawType;
        };

        tools__item.on('click', function(e) {
            var type = _.last(e.target.className.split('_')),

                // convert from css class names to fabric objects
                fabricType = {
                    'rectangle': 'Rect',
                    'ellipse': 'Ellipse',
                    'line': 'Line', // x1, x2, y1, y2
                    'triangle': 'Triangle',
                    'move': 'Move'
                }[type] || DEFAULT_DRAW_TYPE;

            tools__item.removeClass('active');
            $(e.target).addClass('active');

            // set draw type from class name
            NIRS.trigger('set-draw-type', fabricType);
        });

        bindDraw(canvas);

        // precent objects selection
        canvas.selection = false;

        setInterval(function() {
            canvas.renderAll();
        }, 15);
    });

    /**
     * Bind handlers to canvas events
     *
     * @param {fabric.Canvas} canvas
     */
    function bindDraw(canvas) {
        // params of canvas object
        var canvasOffset = $(canvas.upperCanvasEl).offset(),
            startCoord = {},
            // not needed draw if drawType === 'Move'
            drawType,
            drawingObj;

        canvas.on('mouse:down', function(options) {
            drawType = NIRS.getDrawType();

            if (drawType === 'Move') return;

            startCoord = {
                left: options.e.clientX - canvasOffset.left,
                top: options.e.clientY - canvasOffset.top,
            };

            drawingObj = draw.createDrawingObj(canvas, {
                type: drawType,
                left: startCoord.left,
                top: startCoord.top
            });
        });

        // TODO: _.throttle
        canvas.on('mouse:move', function(options) {
            if (drawType === 'Move') return;

            drawingObj && drawingObj.update({
                left: options.e.clientX - canvasOffset.left - startCoord.left,
                top: options.e.clientY - canvasOffset.top - startCoord.top
            });
        });

        canvas.on('mouse:up', function(options) {
            drawingObj = undefined;
        });
    }
});

@@ -1023,24 +1023,64 @@
 'Triangle',%0A
+                    'cursor': 'Cursor',%0A
             
@@ -1094,32 +1094,32 @@
  'move': 'Move'%0A
-
                 
@@ -2011,35 +2011,40 @@
     if (
-drawType === 'Move'
+notNeedDrawing(drawType)
 ) return
@@ -2498,35 +2498,40 @@
     if (
-drawType === 'Move'
+notNeedDrawing(drawType)
 ) return
@@ -2848,16 +2848,16 @@
 efined;%0A
-
         
@@ -2865,13 +2865,222 @@
 );%0A    %7D
+%0A%0A    /**%0A     * @param %7BString%7D drawType%0A     *%0A     * @return %7BBoolean%7D true if not needing drawing%0A     */%0A    function notNeedDrawing(drawType) %7B%0A        return ~%5B'Move', 'Cursor'%5D.indexOf(drawType);%0A    %7D
 %0A%7D);%0A

disable drawing for Cursor