Prevent switch to edit mode when a user clicks on a link (#4661)

* prevent formattable field from switching to edit mode if the user clicks a link

* no need for ...
pull/4664/head
Manu Schiller 8 years ago committed by Oliver Günther
parent d471a04815
commit 86d03c301e
  1. 2
      frontend/app/components/wp-display/field-types/wp-display-formattable-field.directive.html
  2. 17
      frontend/app/components/wp-display/helpers/wp-display-formattable-field-helper.directive.ts

@ -1,4 +1,4 @@
<span>
<span ng-bind-html="$ctrl.displayText"></span>
<span ng-bind-html="$ctrl.displayText" wp-display-formattable-field-helper></span>
</span>

@ -0,0 +1,17 @@
export class WpDisplayFormattableFieldHelper {
constructor(protected $scope,
protected $element) {
$element.on('click', 'a', function (evt) {
evt.stopPropagation();
});
}
}
function wpDisplayFormattableFieldHelper():ng.IDirective {
return {
restrict: 'A',
controller: WpDisplayFormattableFieldHelper
};
}
angular.module('openproject.workPackages.directives').directive('wpDisplayFormattableFieldHelper', wpDisplayFormattableFieldHelper)
Loading…
Cancel
Save