Add new utils.
This commit is contained in:
parent
c1818eec1d
commit
7df512d5a2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue