From c92bcb822c460b5d775d95234106508cb9ca2cc2 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 30 Jun 2017 16:27:31 -0500 Subject: refactor star.js to use ES class syntax --- app/assets/javascripts/star.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/assets/javascripts/star.js') 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; -- cgit v1.2.1