Skip to content
Snippets Groups Projects
Commit 80f6cbcb authored by Diego Sampaio's avatar Diego Sampaio
Browse files

added callbacks to sideNav open and close

parent 0946e039
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@
return invalid
return false;
toggleFlex = (status) ->
toggleFlex = (status, callback = null) ->
return if animating == true
animating = true
if flexNav.opened or status? is -1
......@@ -50,6 +50,7 @@
flexNav.addClass "hidden"
setTimeout ->
animating = false
callback?()
, 350
return
if not flexNav.opened or status? is 1
......@@ -60,19 +61,19 @@
, 50
setTimeout ->
animating = false
callback?()
, 500
openFlex = ->
openFlex = (callback = null) ->
return if animating == true
toggleArrow 1
toggleFlex 1
toggleFlex 1, callback
focusInput()
closeFlex = ->
closeFlex = (callback = null) ->
return if animating == true
toggleArrow -1
toggleFlex -1
toggleFlex -1, callback
flexStatus = ->
return flexNav.opened
......
......@@ -56,10 +56,12 @@ Template.createChannelFlex.events
$('#channel-members').focus()
'click header': (e, instance) ->
SideNav.closeFlex()
SideNav.closeFlex ->
instance.clearForm()
'click .cancel-channel': (e, instance) ->
SideNav.closeFlex()
SideNav.closeFlex ->
instance.clearForm()
'mouseenter header': ->
SideNav.overArrow()
......@@ -90,9 +92,8 @@ Template.createChannelFlex.events
else
return toastr.error err.reason
SideNav.closeFlex()
instance.clearForm()
SideNav.closeFlex ->
instance.clearForm()
FlowRouter.go 'room', { _id: result.rid }
else
......
......@@ -55,12 +55,12 @@ Template.privateGroupsFlex.events
$('#pvt-group-members').focus()
'click .cancel-pvt-group': (e, instance) ->
SideNav.closeFlex()
instance.clearForm()
SideNav.closeFlex ->
instance.clearForm()
'click header': (e, instance) ->
SideNav.closeFlex()
instance.clearForm()
SideNav.closeFlex ->
instance.clearForm()
'mouseenter header': ->
SideNav.overArrow()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment