From 488a01f8a543e67a0cfbe711098097c41a1f36d3 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 15 Feb 2017 16:58:08 -0500 Subject: [PATCH] Js snake case to camel case --- public/js/manga_edit.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/public/js/manga_edit.js b/public/js/manga_edit.js index 33b93ca6..2bd2f492 100644 --- a/public/js/manga_edit.js +++ b/public/js/manga_edit.js @@ -6,13 +6,13 @@ 'use strict'; _.on('.manga.list', 'click', '.edit_buttons button', e => { - let this_sel = e.target; - let parent_sel = _.closestParent(e.target, 'article'); - let manga_id = parent_sel.id.replace("manga-", ""); - let type = this_sel.classList.contains("plus_one_chapter") ? 'chapter' : 'volume'; - let completed = parseInt(_.$(`.${type}s_read`, parent_sel)[0].textContent, 10); - let total = parseInt(_.$(`.${type}_count`, parent_sel)[0].textContent, 10); - let manga_name = _.$('.name', parent_sel)[0].textContent; + 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 completed = parseInt(_.$(`.${type}s_read`, parentSel)[0].textContent, 10); + let total = parseInt(_.$(`.${type}_count`, parentSel)[0].textContent, 10); + let mangaName = _.$('.name', parentSel)[0].textContent; if (isNaN(completed)) { completed = 0; @@ -20,7 +20,7 @@ // Setup the update data let data = { - id: manga_id, + id: mangaId, data: { progress: completed } @@ -47,16 +47,16 @@ mimeType: 'application/json', success: () => { if (data.data.status == 'completed') { - _.hide(parent_sel); + _.hide(parentSel); } - _.$(`.${type}s_read`, parent_sel)[0].textContent = completed; - _.showMessage('success', `Sucessfully updated ${manga_name}`); + _.$(`.${type}s_read`, parentSel)[0].textContent = completed; + _.showMessage('success', `Sucessfully updated ${mangaName}`); _.scrollToTop(); }, error: (xhr, errorType, error) => { console.error(error); - _.showMessage('error', `Failed to updated ${manga_name}`); + _.showMessage('error', `Failed to updated ${mangaName}`); _.scrollToTop(); } });