'use strict';

app.directive('specialFunction', function ($modal, $timeout) {
	return {
		restrict: 'A',
		scope: {
			system: '=',
			steps: '='
		},
		controller: function($scope, $element) {
			$scope.specialFuncTypes = [{name:'Variable', value:0}, {name:'If/Else', value:1}];
			$scope.sfunc = {type:0};
			var modal = $modal({scope: $scope, title: 'Special Functions', template: 'views/modal-tpls/special-function.html', show: false});
			
			$element.on('click', function(event) {
				event.preventDefault();
				modal.$promise.then(modal.show);
			});
		}
	};
});