(function(){angular.module("silverpeas.directives").directive("suggestionboxDeletion",["context","$rootScope",function(context,$rootScope){return{restrict:"AE",templateUrl:webContext+"/suggestionBox/jsp/javaScript/angularjs/directives/suggestionbox-deletion.jsp",replace:true,link:function postLink(scope,element,attrs){applyTokenSecurity("#suggestionDeletion");function getClearedDialog(message){jQuery("#suggestionDeletionMessage").html(message);return jQuery("#suggestionDeletion")}scope.remove=function(suggestion,
navigationCall){var message=jQuery("#deleteSuggestionConfirmMessage").html().replace("@name@",suggestion.title);var $confirm=getClearedDialog(message);$confirm.popup("confirmation",{callback:function(){if(!navigationCall){var suggestionBox=scope.suggestionBox;suggestionBox.suggestions.remove(suggestion.id).then(function(){$rootScope.$broadcast("suggestionModified",suggestion.id)});return true}else{jQuery("#suggestionDeletionForm").attr("action",context.componentUriBase+"suggestions/"+suggestion.id+
"/delete").submit();return true}}})}}}}])})();