fix #278
parent
1afe18e8d1
commit
f4575e0f11
|
@ -479,11 +479,19 @@ BacklogDirective = ($repo, $rootscope) ->
|
|||
$scope.filtersSearch = {}
|
||||
$el.on "click", "#show-filters-button", (event) ->
|
||||
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)
|
||||
$el.find("sidebar.filters-bar").toggleClass("active")
|
||||
$('.burndown').css("visibility", "hidden")
|
||||
sidebar.toggleClass("active")
|
||||
target.toggleClass("active")
|
||||
toggleText(target.find(".text"), ["Hide Filters", "Show Filters"]) # TODO: i18n
|
||||
$rootscope.$broadcast("resize")
|
||||
|
||||
link = ($scope, $el, $attrs, $rootscope) ->
|
||||
$ctrl = $el.controller()
|
||||
|
|
|
@ -367,3 +367,32 @@ CheckPermissionDirective = ->
|
|||
return {link:link}
|
||||
|
||||
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)
|
||||
|
|
|
@ -43,7 +43,7 @@ class ProjectsNavigationController extends taiga.Controller
|
|||
return projects
|
||||
|
||||
|
||||
ProjectsNavigationDirective = ($rootscope) ->
|
||||
ProjectsNavigationDirective = ($rootscope, animationFrame) ->
|
||||
overlay = $(".projects-nav-overlay")
|
||||
loadingStart = 0
|
||||
hideMenu = () ->
|
||||
|
@ -70,12 +70,11 @@ ProjectsNavigationDirective = ($rootscope) ->
|
|||
|
||||
$scope.$on "nav:projects-list:open", ->
|
||||
if !$(document.body).hasClass("open-projects-nav")
|
||||
animationFrame.add () ->
|
||||
overlay.show()
|
||||
|
||||
#animation hack
|
||||
setTimeout ( ->
|
||||
animationFrame.add () ->
|
||||
$(document.body).toggleClass("open-projects-nav")
|
||||
), 61
|
||||
|
||||
$el.on "click", ".projects-list > li > a", (event) ->
|
||||
$(document.body)
|
||||
|
@ -89,7 +88,7 @@ ProjectsNavigationDirective = ($rootscope) ->
|
|||
}
|
||||
|
||||
|
||||
module.directive("tgProjectsNav", ["$rootScope", ProjectsNavigationDirective])
|
||||
module.directive("tgProjectsNav", ["$rootScope", "animationFrame", ProjectsNavigationDirective])
|
||||
|
||||
|
||||
#############################################################################
|
||||
|
|
Loading…
Reference in New Issue