Fixing show filters behaviour in backlog

stable
Alejandro Alonso 2014-06-24 12:16:02 +02:00
parent 24b8760444
commit b37e062d4e
4 changed files with 17 additions and 5 deletions

View File

@ -53,8 +53,8 @@ CreateEditUserstoryDirective = ($repo, $model, $rs) ->
isNew = true isNew = true
editDescription($scope, $el) editDescription($scope, $el)
# Update texts for creation # Update texts for creation
$el.find(".button-green span").html("Create") $el.find(".button-green span").html("Create") #TODO: i18n
$el.find(".title").html("New user story ") $el.find(".title").html("New user story ") #TODO: i18n
$el.removeClass("hidden") $el.removeClass("hidden")
$scope.$on "usform:edit", (ctx, us) -> $scope.$on "usform:edit", (ctx, us) ->
@ -62,8 +62,8 @@ CreateEditUserstoryDirective = ($repo, $model, $rs) ->
isNew = false isNew = false
editDescription($scope, $el) editDescription($scope, $el)
# Update texts for edition # Update texts for edition
$el.find(".button-green span").html("Save") $el.find(".button-green span").html("Save") #TODO: i18n
$el.find(".title").html("Edit user story ") $el.find(".title").html("Edit user story ") #TODO: i18n
$el.removeClass("hidden") $el.removeClass("hidden")
# Update requirement info (team, client or blocked) # Update requirement info (team, client or blocked)

View File

@ -21,6 +21,7 @@
taiga = @.taiga taiga = @.taiga
mixOf = @.taiga.mixOf mixOf = @.taiga.mixOf
toggleText = @.taiga.toggleText
class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin) class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin)
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q) -> constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q) ->
@ -208,7 +209,10 @@ BacklogDirective = ($repo) ->
$scope.filtersSearch = {} $scope.filtersSearch = {}
$el.on "click", "#show-filters-button", (event) -> $el.on "click", "#show-filters-button", (event) ->
event.preventDefault() event.preventDefault()
target = angular.element(event.currentTarget)
$el.find("sidebar.filters-bar").toggle() $el.find("sidebar.filters-bar").toggle()
target.toggleClass("active")
toggleText(target.find(".text"), ["Hide Filters", "Show Filters"]) # TODO: i18n
$el.on "click", "section.filters a.single-filter", (event) -> $el.on "click", "section.filters a.single-filter", (event) ->
event.preventDefault() event.preventDefault()

View File

@ -43,8 +43,15 @@ mixOf = (base, mixins...) ->
trim = (data, char) -> trim = (data, char) ->
return _.str.trim(data, char) return _.str.trim(data, char)
toggleText = (element, texts) ->
nextTextPosition = element.data('nextTextPosition')
nextTextPosition = 0 if not nextTextPosition? or nextTextPosition >= texts.length
text = texts[nextTextPosition]
element.data('nextTextPosition', nextTextPosition + 1)
element.text(text)
taiga = @.taiga taiga = @.taiga
taiga.bindOnce = bindOnce taiga.bindOnce = bindOnce
taiga.mixOf = mixOf taiga.mixOf = mixOf
taiga.trim = trim taiga.trim = trim
taiga.toggleText = toggleText

View File

@ -2,7 +2,8 @@
.trans-button { .trans-button {
@extend %large; @extend %large;
font-family: 'ostrichSans'; font-family: 'ostrichSans';
&:hover { &:hover,
&.active {
@include transition (color .3s linear); @include transition (color .3s linear);
color: $green-taiga; color: $green-taiga;
} }