summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-06-30 16:27:31 -0500
committerMike Greiling <mike@pixelcog.com>2017-06-30 16:27:31 -0500
commit916f685c96e55f799d525911579f01ce5c42cfaf (patch)
treeee1086af006df4853fb53c87f1a3a418bd217ad6
parentd753089ea7fda660f46de972cfc924e7a3feba62 (diff)
downloadgitlab-ce-916f685c96e55f799d525911579f01ce5c42cfaf.tar.gz
refactor star.js to use ES class syntax
-rw-r--r--app/assets/javascripts/star.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/star.js b/app/assets/javascripts/star.js
index 840ae1edd9d..f4784901453 100644
--- a/app/assets/javascripts/star.js
+++ b/app/assets/javascripts/star.js
@@ -1,8 +1,8 @@
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-unused-vars, one-var, no-var, one-var-declaration-per-line, prefer-arrow-callback, no-new, max-len */
/* global Flash */
-window.Star = (function() {
- function Star() {
+class Star {
+ constructor() {
$('.project-home-panel .toggle-star').on('ajax:success', function(e, data, status, xhr) {
var $starIcon, $starSpan, $this, toggleStar;
$this = $(this);
@@ -23,6 +23,6 @@ window.Star = (function() {
new Flash('Star toggle failed. Try again later.', 'alert');
});
}
+}
- return Star;
-})();
+window.Star = Star;