diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-07-01 00:27:31 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-07-06 18:10:00 +0300 |
commit | c92bcb822c460b5d775d95234106508cb9ca2cc2 (patch) | |
tree | 8f09aeda3a55da663302fbd18ce96545a002b889 /app/assets/javascripts/star.js | |
parent | cbef9f08f5e3112631e7e083b55d90d6550942f1 (diff) |
refactor star.js to use ES class syntax
Diffstat (limited to 'app/assets/javascripts/star.js')
-rw-r--r-- | app/assets/javascripts/star.js | 8 |
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; |