Added a common util to get project slug.

This commit is contained in:
Fatih Acet 2016-06-07 04:10:47 +03:00
parent 8aad788383
commit b13f6fa99d
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
((w) ->
w.gl or= {}
w.gl.utils or= {}
w.gl.utils.getProjectSlug = ->
$body = $ 'body'
isInProjectPage = $body.data('page').split(':')[0] is 'projects'
return if isInProjectPage then $body.data 'project' else null
) window