Commit 7df512d5 authored by Fatih Acet's avatar Fatih Acet

Add new utils.

parent c1818eec
......@@ -3,11 +3,24 @@
w.gl or= {}
w.gl.utils or= {}
w.gl.utils.isInGroupsPage = ->
return $('body').data('page').split(':')[0] is 'groups'
w.gl.utils.isInProjectPage = ->
return $('body').data('page').split(':')[0] is 'projects'
w.gl.utils.getProjectSlug = ->
$body = $ 'body'
isInProjectPage = $body.data('page').split(':')[0] is 'projects'
return if @isInProjectPage() then $('body').data 'project' else null
w.gl.utils.getGroupSlug = ->
return if @isInGroupsPage() then $('body').data 'group' else null
return if isInProjectPage then $body.data 'project' else null
) window
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment