From aa1b6315c7c58733a2336aeb57026aefd40ae100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Juli=C3=A1n?= Date: Fri, 8 Apr 2016 14:05:27 +0200 Subject: [PATCH] history tabs wrong behavior --- app/coffee/modules/common/history.coffee | 6 +++--- app/partials/common/history/history-base.jade | 13 +++++++++---- app/styles/modules/common/history.scss | 19 +++++++------------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/coffee/modules/common/history.coffee b/app/coffee/modules/common/history.coffee index bbc1beb4..f426a66a 100644 --- a/app/coffee/modules/common/history.coffee +++ b/app/coffee/modules/common/history.coffee @@ -421,7 +421,7 @@ HistoryDirective = ($log, $loading, $qqueue, $template, $confirm, $translate, $c # Events - $el.on "click", ".add-comment button.button-green", debounce 2000, (event) -> + $el.on "click", ".add-comment .button-green", debounce 2000, (event) -> event.preventDefault() target = angular.element(event.currentTarget) @@ -467,10 +467,10 @@ HistoryDirective = ($log, $loading, $qqueue, $template, $confirm, $translate, $c $el.on "focus", ".add-comment textarea", (event) -> $(this).addClass('active') - $el.on "click", ".history-tabs li a", (event) -> + $el.on "click", ".history-tabs li", (event) -> target = angular.element(event.currentTarget) - $el.find(".history-tabs li a").removeClass("active") + $el.find(".history-tabs li").removeClass("active") target.addClass("active") $el.find(".history section").addClass("hidden") diff --git a/app/partials/common/history/history-base.jade b/app/partials/common/history/history-base.jade index 3d8f1874..bd5949e7 100644 --- a/app/partials/common/history/history-base.jade +++ b/app/partials/common/history/history-base.jade @@ -4,15 +4,20 @@ section.history <% if (commentsVisible || historyVisible) { %> ul.history-tabs <% if (commentsVisible) { %> - li - a(href="#", class="active", data-section-class="history-comments") + li( + class="active" + data-section-class="history-comments" + ) + a(href="") svg.icon.icon-writer use(xlink:href="#icon-writer") span.tab-title(translate="COMMENTS.TITLE") <% } %> <% if (historyVisible) { %> - li - a(href="#", data-section-class="history-activity") + li( + data-section-class="history-activity" + ) + a(href="") svg.icon.icon-timeline use(xlink:href="#icon-timeline") span.tab-title(translate="ACTIVITY.TITLE") diff --git a/app/styles/modules/common/history.scss b/app/styles/modules/common/history.scss index f39e2247..5efc4295 100644 --- a/app/styles/modules/common/history.scss +++ b/app/styles/modules/common/history.scss @@ -45,21 +45,10 @@ margin-bottom: 0; li { @extend %large; - display: inline-block; - &:first-child { - border-right: 1px solid $whitish; - } - &:last-child { - border-right: 0; - } - } - a { background: $white; - color: $gray-light; + border-right: 1px solid $whitish; display: inline-block; - padding: .5rem 2rem; position: relative; - transition: color .2s ease-in; &.active { color: $primary; top: 1px; @@ -69,6 +58,12 @@ transition: color .2s ease-in; } } + a { + color: $gray-light; + display: block; + padding: .5rem 2rem; + transition: color .2s ease-in; + } .icon { fill: currentColor; height: .75rem;