Commit c92bcb82 authored by Mike Greiling's avatar Mike Greiling

refactor star.js to use ES class syntax

parent cbef9f08
/* 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 */ /* 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 */ /* global Flash */
window.Star = (function() { class Star {
function Star() { constructor() {
$('.project-home-panel .toggle-star').on('ajax:success', function(e, data, status, xhr) { $('.project-home-panel .toggle-star').on('ajax:success', function(e, data, status, xhr) {
var $starIcon, $starSpan, $this, toggleStar; var $starIcon, $starSpan, $this, toggleStar;
$this = $(this); $this = $(this);
...@@ -23,6 +23,6 @@ window.Star = (function() { ...@@ -23,6 +23,6 @@ window.Star = (function() {
new Flash('Star toggle failed. Try again later.', 'alert'); new Flash('Star toggle failed. Try again later.', 'alert');
}); });
} }
}
return Star; window.Star = Star;
})();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment