Verify comment is not null

This commit is contained in:
Bartek Fabiszewski 2020-02-16 19:24:23 +01:00
parent e918dbccb0
commit 2de03383f6

View File

@ -63,7 +63,7 @@ export default class PositionDialogModel extends ViewModel {
<div style="clear: both; padding-bottom: 1em;"></div>
<form id="positionForm">
<label><b>${$._('comment')}</b></label><br>
<textarea style="width:100%;" maxlength="255" rows="5" placeholder="${$._('comment')}" name="comment" data-bind="comment">${uUtils.htmlEncode(this.position.comment)}</textarea>
<textarea style="width:100%;" maxlength="255" rows="5" placeholder="${$._('comment')}" name="comment" data-bind="comment">${this.position.hasComment() ? uUtils.htmlEncode(this.position.comment) : ''}</textarea>
<div class="buttons">
<button class="button-reject" data-bind="onCancel" type="button">${$._('cancel')}</button>
<button class="button-resolve" data-bind="onPositionUpdate" type="submit">${$._('submit')}</button>
@ -106,9 +106,6 @@ export default class PositionDialogModel extends ViewModel {
* @return {boolean} True if valid
*/
validate() {
if (this.model.comment === this.position.comment) {
return false;
}
return true;
return this.model.comment !== this.position.comment;
}
}