From 23d78c3b284eaf97f18a419be4d608660431124b Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Thu, 16 Feb 2017 13:22:26 -0500 Subject: [PATCH] More javascript style fixes --- public/js/base/AnimeClient.js | 4 ++-- public/js/base/events.js | 2 +- public/js/manga_collection.js | 4 ++-- public/js/manga_edit.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/public/js/base/AnimeClient.js b/public/js/base/AnimeClient.js index b8d85fa2..180a0756 100644 --- a/public/js/base/AnimeClient.js +++ b/public/js/base/AnimeClient.js @@ -226,7 +226,7 @@ var AnimeClient = (function(w) { }); return pairs.join('&'); - }; + } /** * Make an ajax request @@ -308,7 +308,7 @@ var AnimeClient = (function(w) { } return _.ajax(url, { - data: data, + data, success: callback }); }; diff --git a/public/js/base/events.js b/public/js/base/events.js index ae30ebb7..b7462294 100644 --- a/public/js/base/events.js +++ b/public/js/base/events.js @@ -12,7 +12,7 @@ // Confirm deleting of list or library items ac.on('form.js-delete', 'submit', (event) => { - const proceed = confirm("Are you ABSOLUTELY SURE you want to delete this item?"); + const proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?'); if (proceed === false) { event.preventDefault(); diff --git a/public/js/manga_collection.js b/public/js/manga_collection.js index 137ea46c..1d3dccbf 100644 --- a/public/js/manga_collection.js +++ b/public/js/manga_collection.js @@ -4,7 +4,7 @@ const search = (tempHtml, query) => { _.$('.cssload-loader')[0].removeAttribute('hidden'); - _.get(_.url('/manga/search'), {'query':query,}, (searchResults, status) => { + _.get(_.url('/manga/search'), {query}, (searchResults, status) => { searchResults = JSON.parse(searchResults); _.$('.cssload-loader')[0].setAttribute('hidden', 'hidden'); @@ -13,7 +13,7 @@ }); }; - _.get('/public/templates/manga-ajax-search-results.html', tempHtml => { + _.get('/public/templates/manga-ajax-search-results.html', (tempHtml) => { _.on('#search', 'keyup', _.throttle(250, function(e) { let query = encodeURIComponent(this.value); if (query === '') { diff --git a/public/js/manga_edit.js b/public/js/manga_edit.js index b0fdf222..7fa89a66 100644 --- a/public/js/manga_edit.js +++ b/public/js/manga_edit.js @@ -8,8 +8,8 @@ _.on('.manga.list', 'click', '.edit_buttons button', (e) => { let thisSel = e.target; let parentSel = _.closestParent(e.target, 'article'); - let mangaId = parentSel.id.replace("manga-", ""); - let type = thisSel.classList.contains("plus_one_chapter") ? 'chapter' : 'volume'; + let mangaId = parentSel.id.replace('manga-', ''); + let type = thisSel.classList.contains('plus_one_chapter') ? 'chapter' : 'volume'; let completed = parseInt(_.$(`.${type}s_read`, parentSel)[0].textContent, 10); let total = parseInt(_.$(`.${type}_count`, parentSel)[0].textContent, 10); let mangaName = _.$('.name', parentSel)[0].textContent;