From c5cc99d7d3c8ba6eba81ad64dc47055dbf62ecfc Mon Sep 17 00:00:00 2001
From: YarekTenko <yarektenko@gmail.com>
Date: Wed, 12 Apr 2017 10:24:19 -0700
Subject: [PATCH] Rewrite JavaScript files according to linter specs

---
 app/assets/javascripts/application.js     | 31 +++++++++++++----------
 app/assets/javascripts/bets.js            | 10 ++++----
 app/assets/javascripts/cable.js           | 11 ++++----
 app/assets/javascripts/lib/date_picker.js |  6 ++---
 4 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 1c17277..5a08e3e 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -1,19 +1,22 @@
-// This is a manifest file that'll be compiled into application.js, which will include all the files
-// listed below.
+// This is a manifest file that'll be compiled into application.js,
+// which will include all the files listed below.
 //
-// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
-// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts,
+// vendor/assets/javascripts, or any plugin's vendor/assets/javascripts
+// directory can be referenced here using a relative path.
 //
-// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
-// compiled file. JavaScript code in this file should be added after the last require_* statement.
+// It's not advisable to add code directly here, but if you do, it'll appear
+// at the bottom of the compiled file. JavaScript code in this file should be
+// added after the last require_* statement.
 //
-// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
+// Read Sprockets README
+// (https://github.com/rails/sprockets#sprockets-directives) for details
 // about supported directives.
 //
-//= require jquery
-//= require tether
-//= require bootstrap-sprockets
-//= require jquery_ujs
-//= require lib/date_picker
-//= require turbolinks
-//= require_tree .
+// = require jquery
+// = require tether
+// = require bootstrap-sprockets
+// = require jquery_ujs
+// = require lib/date_picker
+// = require turbolinks
+// = require_tree .
diff --git a/app/assets/javascripts/bets.js b/app/assets/javascripts/bets.js
index 307a227..b6aacc0 100644
--- a/app/assets/javascripts/bets.js
+++ b/app/assets/javascripts/bets.js
@@ -1,9 +1,9 @@
 $(document).on('turbolinks:load', function() {
-  $(".table-selectable tr").on('click', function(event){
-    $("tr").removeClass("table-success");
-    if (event.target.type !== "radio"){
-      $(":radio", this).trigger('click')
+  $('.table-selectable tr').on('click', function(event) {
+    $('tr').removeClass('table-success');
+    if (event.target.type !== 'radio') {
+      $(':radio', this).trigger('click');
     }
-    $(this).addClass("table-success");
+    $(this).addClass('table-success');
   });
 });
diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js
index 71ee1e6..d2705b1 100644
--- a/app/assets/javascripts/cable.js
+++ b/app/assets/javascripts/cable.js
@@ -1,13 +1,12 @@
 // Action Cable provides the framework to deal with WebSockets in Rails.
-// You can generate new channels where WebSocket features live using the rails generate channel command.
+// You can generate new channels where WebSocket features live using the rails
+// generate channel command.
 //
-//= require action_cable
-//= require_self
-//= require_tree ./channels
+// = require action_cable
+// = require_self
+// = require_tree ./channels
 
 (function() {
   this.App || (this.App = {});
-
   App.cable = ActionCable.createConsumer();
-
 }).call(this);
diff --git a/app/assets/javascripts/lib/date_picker.js b/app/assets/javascripts/lib/date_picker.js
index 9a2bcc5..ca63cca 100644
--- a/app/assets/javascripts/lib/date_picker.js
+++ b/app/assets/javascripts/lib/date_picker.js
@@ -1,5 +1,5 @@
-$(document).on("turbolinks:load", function(){
-  $(".jquery-datepicker").datetimepicker({
-    minDate: "0"
+$(document).on('turbolinks:load', function() {
+  $('.jquery-datepicker').datetimepicker( {
+    minDate: '0',
   });
 });