From d27f612bb8e4e2466582378b09eaa5518953cf1f Mon Sep 17 00:00:00 2001 From: Juanfran Date: Wed, 3 Jun 2015 10:10:10 +0200 Subject: [PATCH] prevent comment save if the textarea doesn't have content --- app/coffee/modules/common/history.coffee | 3 +-- app/partials/common/history/history-base.jade | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/coffee/modules/common/history.coffee b/app/coffee/modules/common/history.coffee index 4dff84db..b44eefc7 100644 --- a/app/coffee/modules/common/history.coffee +++ b/app/coffee/modules/common/history.coffee @@ -375,11 +375,10 @@ HistoryDirective = ($log, $loading, $qqueue, $template, $confirm, $translate, $c # Events - $el.on "click", ".add-comment a.button-green", debounce 2000, (event) -> + $el.on "click", ".add-comment input.button-green", debounce 2000, (event) -> event.preventDefault() target = angular.element(event.currentTarget) - save(target) $el.on "click", ".show-more", (event) -> diff --git a/app/partials/common/history/history-base.jade b/app/partials/common/history/history-base.jade index ad720c45..ff6b9052 100644 --- a/app/partials/common/history/history-base.jade +++ b/app/partials/common/history/history-base.jade @@ -16,8 +16,7 @@ section.history a(class="help-markdown", href="https://taiga.io/support/taiga-markdown-syntax/", target="_blank", title="{{'COMMON.WYSIWYG.MARKDOWN_HELP' | translate}}") span.icon.icon-help span(translate="COMMON.WYSIWYG.MARKDOWN_HELP") - a(href="", title="{{'COMMENTS.COMMENT' | translate}}", class="button button-green save-comment") - span(translate="COMMENTS.COMMENT") + input(type="button", ng-disabled!="!<%- ngmodel %>.comment.length" title="{{'COMMENTS.COMMENT' | translate}}", value="{{'COMMENTS.COMMENT' | translate}}", class="button button-green save-comment") <% } %> section.history-activity.hidden .changes-list