Source: site/activityChange.js

// Generated by CoffeeScript 1.12.7

/**
 * History change
 * @module
 */
'use strict';
app.directive('activityChange', [
  'constantService', function(constants) {
    return {
      restrict: 'A',
      transclude: 'element',
      priority: 500,
      link: function($scope, $element, $attrs, ctrl, $transclude) {
        var act, add, af, afi, dd, dt, field, ref, val;
        af = $attrs.activityChange;
        afi = af.lastIndexOf('.');
        act = $scope.$eval(af.substring(0, afi));
        field = af.substring(afi + 1);
        val = {
          "new": act[field],
          old: (ref = act.old) != null ? ref[field] : void 0
        };
        if (!((val.old != null) || (val["new"] != null))) {
          return;
        }
        dt = $('<dt/>').text($attrs.title || constants.message($attrs.titleMessage));
        dt.append(':');
        dt.addClass('activity-change-title');
        dd = $('<dd/>');
        add = function(which) {
          var scope;
          if (val[which] == null) {
            return;
          }
          scope = $scope.$new();
          scope.value = val[which];
          return $transclude(scope, function(clone) {
            clone.addClass('activity-' + which);
            return dd.append(clone);
          });
        };
        add('old');
        dd.append('<wbr>');
        add('new');
        $element.after(dt, dd);
      }
    };
  }
]);

//# sourceMappingURL=activityChange.js.map