text: if (typeof define !== 'function') { var define = require('amdefine')(module) }
  define( function(require,exports,module)
  {
      const BaseView = require('core_plugins/base_plugin/views/base_view').View;
      const $        = require('jquery');
  
      class ImagePreviewView extends BaseView {
          constructor(params) {
              super(params);
              this.config = JSON.parse(JSON.stringify(this.config));
              this.config.PLACEHOLDER     = "#es-container";
              this.config.ELEMENT         = ".es-table-view";
              this.template_view          = "image_preview_view";
              this.events = {
                  'mouseover .es-table-cell': 'showCellPreview',
              };
              this.initializeElements();
              super.render();
          }
  
          initializeElements()
          {
              super.initializeElements();
              this.cellPreviewElement = $("#cell-preview");
          }
  
          showCellPreview(e)
          {
              let cell  = $(e.currentTarget);
              let xOffset = 10;
              let yOffset = 10;
  
              if((/\.(gif|jpg|jpeg|tiff|png)$/i).test(cell.text())){//image
                  this.cellPreviewElement.html("<img src='" + cell.html() + "' alt='Image preview' />");
              }else{
                  return;
              }
  
              this.cellPreviewElement.css({
                  "top": (e.pageY - yOffset)  + "px",
                  "left": (e.pageX + xOffset) + "px",
                  'display': 'block'
              });
  
              cell.on('mouseleave', function (e) {
                  this.cellPreviewElement.off('click');
                  this.cellPreviewElement.hide();
              }.bind(this));
          }
  
      }
  
      module.exports.View = ImagePreviewView;
  });