Juanfran 2014-08-07 14:15:41 +02:00
parent 1afe18e8d1
commit f4575e0f11
3 changed files with 44 additions and 8 deletions

View File

@ -479,11 +479,19 @@ BacklogDirective = ($repo, $rootscope) ->
$scope.filtersSearch = {} $scope.filtersSearch = {}
$el.on "click", "#show-filters-button", (event) -> $el.on "click", "#show-filters-button", (event) ->
event.preventDefault() event.preventDefault()
sidebar = $el.find("sidebar.filters-bar")
sidebar.one "transitionend", () ->
setTimeout ( ->
$rootscope.$broadcast("resize")
$('.burndown').css("visibility", "visible")
), 150
target = angular.element(event.currentTarget) target = angular.element(event.currentTarget)
$el.find("sidebar.filters-bar").toggleClass("active") $('.burndown').css("visibility", "hidden")
sidebar.toggleClass("active")
target.toggleClass("active") target.toggleClass("active")
toggleText(target.find(".text"), ["Hide Filters", "Show Filters"]) # TODO: i18n toggleText(target.find(".text"), ["Hide Filters", "Show Filters"]) # TODO: i18n
$rootscope.$broadcast("resize")
link = ($scope, $el, $attrs, $rootscope) -> link = ($scope, $el, $attrs, $rootscope) ->
$ctrl = $el.controller() $ctrl = $el.controller()

View File

@ -367,3 +367,32 @@ CheckPermissionDirective = ->
return {link:link} return {link:link}
module.directive("tgCheckPermission", CheckPermissionDirective) module.directive("tgCheckPermission", CheckPermissionDirective)
#############################################################################
## Animation frame service, apply css changes in the next render frame
#############################################################################
AnimationFrame = () ->
animationFrame =
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame
performAnimation = (time) =>
fn = tail.shift()
fn()
if (tail.length)
animationFrame(performAnimation)
tail = []
add = () ->
for fn in arguments
tail.push(fn)
if tail.length == 1
animationFrame(performAnimation)
return {add: add}
module.factory("animationFrame", AnimationFrame)

View File

@ -43,7 +43,7 @@ class ProjectsNavigationController extends taiga.Controller
return projects return projects
ProjectsNavigationDirective = ($rootscope) -> ProjectsNavigationDirective = ($rootscope, animationFrame) ->
overlay = $(".projects-nav-overlay") overlay = $(".projects-nav-overlay")
loadingStart = 0 loadingStart = 0
hideMenu = () -> hideMenu = () ->
@ -70,12 +70,11 @@ ProjectsNavigationDirective = ($rootscope) ->
$scope.$on "nav:projects-list:open", -> $scope.$on "nav:projects-list:open", ->
if !$(document.body).hasClass("open-projects-nav") if !$(document.body).hasClass("open-projects-nav")
animationFrame.add () ->
overlay.show() overlay.show()
#animation hack animationFrame.add () ->
setTimeout ( ->
$(document.body).toggleClass("open-projects-nav") $(document.body).toggleClass("open-projects-nav")
), 61
$el.on "click", ".projects-list > li > a", (event) -> $el.on "click", ".projects-list > li > a", (event) ->
$(document.body) $(document.body)
@ -89,7 +88,7 @@ ProjectsNavigationDirective = ($rootscope) ->
} }
module.directive("tgProjectsNav", ["$rootScope", ProjectsNavigationDirective]) module.directive("tgProjectsNav", ["$rootScope", "animationFrame", ProjectsNavigationDirective])
############################################################################# #############################################################################