summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-09-07 10:26:51 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-09-07 10:26:51 +0100
commit38bcf699abf1f8cec7b4e11c914e1baae57f9b81 (patch)
treec76bf0a8ba84869abf7e02a5e1372a27d04bbed8 /app/assets/javascripts
parentedfb5d7b16f064519c7408eb69dd125726b0c652 (diff)
downloadgitlab-ce-38bcf699abf1f8cec7b4e11c914e1baae57f9b81.tar.gz
Get the project path through the DOM instead of `gon`
Open the settings section based on the location hash
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/settings_panels.js4
-rw-r--r--app/assets/javascripts/user_callout.js2
2 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/settings_panels.js b/app/assets/javascripts/settings_panels.js
index 7fa5996d600..8635ccece6e 100644
--- a/app/assets/javascripts/settings_panels.js
+++ b/app/assets/javascripts/settings_panels.js
@@ -41,4 +41,8 @@ export default function initSettingsPanels() {
$section.on('click.toggleSection', '.js-settings-toggle', () => toggleSection($section));
$section.find('.settings-content:not(.expanded)').on('scroll.expandSection', () => expandSection($section));
});
+
+ if (location.hash) {
+ expandSection($(location.hash));
+ }
}
diff --git a/app/assets/javascripts/user_callout.js b/app/assets/javascripts/user_callout.js
index 6165d97f425..a45b22f3084 100644
--- a/app/assets/javascripts/user_callout.js
+++ b/app/assets/javascripts/user_callout.js
@@ -22,7 +22,7 @@ export default class UserCallout {
const $currentTarget = $(e.currentTarget);
if (this.options.setCalloutPerProject) {
- Cookies.set(this.cookieName, 'true', { expires: 365, path: gon.project_path });
+ Cookies.set(this.cookieName, 'true', { expires: 365, path: this.userCalloutBody.data('project-path') });
} else {
Cookies.set(this.cookieName, 'true', { expires: 365 });
}