summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib/utils
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-11 00:06:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-11 00:06:24 +0000
commit133924c6cc443f5f69e1ab08d43b363d77677cb0 (patch)
treee893a7d36105fc4acec7038feae5f03bd34cfc2c /app/assets/javascripts/lib/utils
parentf607152a0802a68067343ad73f989033cb8e9a06 (diff)
downloadgitlab-ce-133924c6cc443f5f69e1ab08d43b363d77677cb0.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/lib/utils')
-rw-r--r--app/assets/javascripts/lib/utils/url_utility.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/url_utility.js b/app/assets/javascripts/lib/utils/url_utility.js
index 7ead9d46fbb..4be0d05a9b7 100644
--- a/app/assets/javascripts/lib/utils/url_utility.js
+++ b/app/assets/javascripts/lib/utils/url_utility.js
@@ -88,6 +88,14 @@ export function getLocationHash(url = window.location.href) {
}
/**
+ * Returns a boolean indicating whether the URL hash contains the given string value
+ */
+export function doesHashExistInUrl(hashName) {
+ const hash = getLocationHash();
+ return hash && hash.includes(hashName);
+}
+
+/**
* Apply the fragment to the given url by returning a new url string that includes
* the fragment. If the given url already contains a fragment, the original fragment
* will be removed.