"use strict";

// Generators for Arethusa code for things such as
// - useful directives

function ArethusaGenerator() {
  this.panelTrigger = function panelTrigger(service, trsl, trslKey, template) {
    return {
      restrict: 'A',
      link: function(scope, element, attrs) {
        function toggle() {
          scope.$apply(service.toggle());
        }

        var parent = element.parent();
        trsl(trslKey, function(translation) {
          parent.attr('title', translation);
        });

        element.bind('click', toggle);
      },
      template: template
    };
  };
}

var arethusaGenerator = new ArethusaGenerator();
var aG = arethusaGenerator;


@@ -238,12 +238,15 @@
     
-link
+compile
 : fu
@@ -256,257 +256,341 @@
 ion(
-scope, element, attrs) %7B%0A        function toggle() %7B%0A          scope.$apply(service.toggle());%0A        %7D%0A%0A        var parent = element.parent();%0A        trsl(trslKey, function(translation) %7B%0A          parent.attr('title', translation);%0A        %7D
+element) %7B%0A        var parent = element.parent();%0A%0A        function updateTitle(translation) %7B%0A          parent.attr('title', translation);%0A        %7D%0A%0A        return function link(scope, element, attrs) %7B%0A          function toggle() %7B%0A            scope.$apply(service.toggle());%0A          %7D%0A%0A          trsl(trslKey, updateTitle
 );%0A%0A
+  
     
@@ -624,16 +624,27 @@
 oggle);%0A
+        %7D;%0A
       %7D,

Refactor panel triggers for speed