'use strict';
define(function() {
  var imgBlock = function() {
    return {
      restrict: 'AE',
      templateUrl: 'js/XG/modules/print/views/directives/blocks/imgBlock.html',
      //controllerAs: 'ModelGUICtrl',
      scope: {
        pagemanager: '=pagemanager',
        selectmanager: '=selectmgr',
      },
      link: function(scope) {
        scope.newBlock = function() {
          var block = {
            label: 'Image',
            type: 'imgBlock',

            render: {
              color: '#002b44',
              w: 250,
              h: 250,
            },

            data: {
              class: 'org.mapfish.print.config.layout.ImageBlock',
              absoluteX: 0,
              absoluteY: 0,
              maxWidth: '250',
              maxHeight: '250',
              spacingAfter: '0',
              align: 'left',
              vertAlign: 'top',
              url: '',
              rotation: 0,
            },
          };
          scope.selectmanager.add(block);
        };
        scope.delBlock = function() {
          scope.deletefct();
        };
      },
    };
  };

  imgBlock.$inject = [];
  return imgBlock;
});
