Skip to content
Snippets Groups Projects
Unverified Commit 7b9b2ce3 authored by Connor Shea's avatar Connor Shea
Browse files

Add a helper function for getting the page path from JS.

parent a99e5cd8
No related branches found
No related tags found
1 merge request!4978Split Cropper.js from the main JavaScript manifest.
Pipeline #
Loading
Loading
@@ -5,12 +5,12 @@
 
w.gl.utils.isInGroupsPage = ->
 
return $('body').data('page').split(':')[0] is 'groups'
return gl.utils.getPagePath() is 'groups'
 
 
w.gl.utils.isInProjectPage = ->
 
return $('body').data('page').split(':')[0] is 'projects'
return gl.utils.getPagePath() is 'projects'
 
 
w.gl.utils.getProjectSlug = ->
Loading
Loading
@@ -40,6 +40,9 @@
e.stopImmediatePropagation()
return false
 
gl.utils.getPagePath = ->
return $('body').data('page').split(':')[0]
 
jQuery.timefor = (time, suffix, expiredLabel) ->
 
Loading
Loading
Loading
Loading
@@ -79,5 +79,5 @@ $ ->
if comment && comment.length > 1 && $title.val() == ''
$title.val(comment[1]).change()
 
if $('body').attr('data-page').split(':').first() == 'profiles'
if gl.utils.getPagePath() == 'profiles'
new Profile()
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