'use strict';
define(function() {
  var toolbarbuttonwidget = function(gcPopup) {
    return {
      templateUrl: 'js/XG/widgets/mapapp/importwfs/views/toolbarimportwfs.html',
      restrict: 'A',

      link: function(scope, element) {
        element.bind('click', function() {
          gcPopup.open({
            scope: scope,
            title: 'Import WFS',
            template:
              'js/XG/widgets/mapapp/importwfs/views/popupimportwfs.html',
            showClose: true,
            id: 'importWFS_toolbar',
          });
          try {
            scope.$apply(scope);
          } catch(err) {}
        });
      },
    };
  };

  toolbarbuttonwidget.$inject = ['gcPopup'];
  return toolbarbuttonwidget;
});
