refactor star.js to use ES class syntax

This commit is contained in:
Mike Greiling 2017-06-30 16:27:31 -05:00
parent cbef9f08f5
commit c92bcb822c
1 changed files with 4 additions and 4 deletions

View File

@ -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;