Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-02-22 03:32:51 +0300
committerJose Ivan Vargas <jvargas@gitlab.com>2017-02-24 00:47:23 +0300
commit621bfdaa9f9abe977310fb2692a4194b5a87347c (patch)
treef169833861526b4ba2c49b53de1cdc61241b4100 /app/assets/javascripts/user_callout.js
parent46eefbda3ae55394bae63872c8ff3d86500a1ddc (diff)
Removed disabled rules from the user_callout_spec.js
Also changed the cookie sets to true and false values to make it consistent with the rest of the javascript. Fixed some haml and a missing new line
Diffstat (limited to 'app/assets/javascripts/user_callout.js')
-rw-r--r--app/assets/javascripts/user_callout.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/app/assets/javascripts/user_callout.js b/app/assets/javascripts/user_callout.js
index 9aa565074e4..c10f0e8de5e 100644
--- a/app/assets/javascripts/user_callout.js
+++ b/app/assets/javascripts/user_callout.js
@@ -1,4 +1,4 @@
-/* eslint-disable arrow-parens, class-methods-use-this, no-param-reassign */
+/* eslint-disable class-methods-use-this */
/* global Cookies */
const userCalloutElementName = '.user-callout';
@@ -11,21 +11,20 @@ class UserCallout {
constructor() {
this.isCalloutDismissed = Cookies.get(USER_CALLOUT_COOKIE);
this.init();
- this.isUserCalloutDismissed();
+ this.toggleUserCallout();
}
init() {
$(document)
- .on('click', closeButton, () => this.closeAndDismissCallout())
- .on('click', userCalloutBtn, () => this.closeAndDismissCallout());
+ .on('click', closeButton, () => this.dismissCallout())
+ .on('click', userCalloutBtn, () => this.dismissCallout());
}
- closeAndDismissCallout() {
- $(userCalloutElementName).hide();
- Cookies.set(USER_CALLOUT_COOKIE, '1');
+ dismissCallout() {
+ Cookies.set(USER_CALLOUT_COOKIE, 'true');
}
- isUserCalloutDismissed() {
+ toggleUserCallout() {
if (!this.isCalloutDismissed) {
$(userCalloutElementName).show();
}