function enableDragging(ctx, element, listener) {

        var mousedown = false;

        addEventListener(element, 'mousedown', function(evt) {
            mousedown = true;
        });
        addEventListener(element, 'mouseup', function(evt) {
            mousedown = false;
        });
        addEventListener(element, 'mouseout', function(evt) {
            mousedown = false;
        });
        addEventListener(element, 'mousemove', function(evt) {

            if (mousedown) {

                listener(evt);
            }
        });
    }
Enable drag&drop color selection.
@param {object} ctx ColorPicker instance.
@param {DOMElement} element HSV slide element or HSV picker element.
@param {Function} listener Function that will be called whenever mouse is dragged over the element with event object as argument.