//# sourceURL=widgets/Image.js
/**
 * $Id: Image.js 300 2018-03-08 18:56:13Z patrick $
 */

import Widget from '../Widget.js';

var Image = function( elem ) {
    Widget.call(this, elem);
    this.name = "Image";
    this.image = $(elem).data('image');
    $(elem).addClass("widget-image");
};

var $fn = Image.prototype = Object.create(Widget.prototype);
Image.prototype.constructor = Image;

$fn.start = function() {
    $(this.elem).removeClass("nodata");
};

$fn.click = function() {
    var link = this.getData( "link", "" );
    if ( "" !== link ) {
        document.location.href = link;
    }
};

export default Image;
