Fix rendering description html

pull/5117/head
Oliver Günther 8 years ago
parent 996403fa3b
commit a060983bd9
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 2
      app/assets/stylesheets/content/work_packages/inplace_editing/_edit_fields.sass
  2. 4
      frontend/app/components/wp-display/field-types/wp-display-formattable-field.directive.html
  3. 10
      frontend/app/components/wp-display/field-types/wp-display-formattable-field.module.ts
  4. 17
      frontend/app/components/wp-display/helpers/wp-display-formattable-field-helper.directive.ts
  5. 2
      spec/support/work_packages/table_work_package_field.rb

@ -89,7 +89,7 @@
vertical-align: middle
// Editable fields cursor
.-editable .wp-table--cell-span
.-editable .wp-table--cell-span,
.wp-table--cell-span.-editable
cursor: text
border-color: transparent

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

@ -31,8 +31,6 @@ import ExpressionService from "../../common/xss/expression.service";
import {HalResource} from "../../api/api-v3/hal-resources/hal-resource.service";
export class FormattableDisplayField extends DisplayField {
public template:string = '/components/wp-display/field-types/wp-display-formattable-field.directive.html'
protected ExpressionService:ExpressionService;
constructor(public resource: HalResource,
@ -43,6 +41,14 @@ export class FormattableDisplayField extends DisplayField {
this.ExpressionService = <ExpressionService>this.$injector.get('ExpressionService');
}
public render(element: HTMLElement, displayText): void {
let span = document.createElement('span');
span.innerHTML = displayText;
element.innerHTML = '';
element.appendChild(span);
}
public get value() {
if(!this.schema) {
return null;

@ -1,17 +0,0 @@
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)

@ -39,7 +39,7 @@ class TableWorkPackageField
begin
element.click
rescue => e
$stderr.puts "Failed to click on field, already active?"
$stderr.puts "Failed to click on field, already active? #{e}"
end
expect_active!
end

Loading…
Cancel
Save