Juanfran 2014-08-08 12:06:22 +02:00
parent 8cb9d370d7
commit 6da9ecbe6e
4 changed files with 43 additions and 6 deletions

View File

@ -396,3 +396,16 @@ AnimationFrame = () ->
return {add: add} return {add: add}
module.factory("animationFrame", AnimationFrame) module.factory("animationFrame", AnimationFrame)
#############################################################################
## Open/close comment
#############################################################################
ToggleCommentDirective = () ->
link = ($scope, $el, $attrs) ->
$el.find("textarea").on "focus", () ->
$el.addClass("active")
return {link:link}
module.directive("tgToggleComment", ToggleCommentDirective)

View File

@ -29,7 +29,21 @@ block content
- var permissionSuffix = "us" - var permissionSuffix = "us"
include views/modules/attachments include views/modules/attachments
textarea(ng-model="us.comment", placeholder="Write here a new commet") section.us-activity
ul.us-activity-tabs
li
a.active(href="#")
span.icon.icon-bulk
span.tab-title Comments
li
a(href="#")
span.icon.icon-issues
span.tab-title Activity
- var commentModel = "us"
include views/modules/comments
include views/modules/activity
sidebar.menu-secondary.sidebar sidebar.menu-secondary.sidebar
section.us-status(tg-us-status-detail, ng-model="us", editable="true") section.us-status(tg-us-status-detail, ng-model="us", editable="true")

View File

@ -1,7 +1,7 @@
//- NOTE: You must to define 'var commentModel' with the object model //- NOTE: You must to define 'var commentModel' with the object model
section.us-comments section.us-comments
div.add-comment(tg-check-permission, permission="modify_"+commentModel) div.add-comment(tg-check-permission, tg-toggle-comment, permission="modify_"+commentModel)
textarea(placeholder="Write here a new commet", ng-model="commentModel.comment") textarea(placeholder="Write here a new commet", ng-model="commentModel.comment")
a.button.button-green(href="", title="Comment") Comment a.button.button-green(href="", title="Comment") Comment
div.comment-list div.comment-list

View File

@ -2,16 +2,26 @@
@include clearfix; @include clearfix;
textarea { textarea {
float: left; float: left;
height: 41px;
margin-bottom: .5rem; margin-bottom: .5rem;
&.active { min-height: inherit;
@include transition(height .3s ease-in);
height: 6rem;
}
} }
a { a {
color: $white; color: $white;
float: right; float: right;
} }
.button-green {
display: none;
}
&.active {
.button-green {
display: block;
}
textarea {
@include transition(height .3s ease-in);
height: 6rem;
}
}
} }
.comment-single { .comment-single {