diff --git a/bookwyrm/static/js/bookwyrm.js b/bookwyrm/static/js/bookwyrm.js index 0ec14336f..b3959e30e 100644 --- a/bookwyrm/static/js/bookwyrm.js +++ b/bookwyrm/static/js/bookwyrm.js @@ -174,30 +174,6 @@ let BookWyrm = new class { } } - /** - * Make a request and update the UI accordingly. - * This function is used for boosts and favourites. - * - * @todo Only update status if the promise is successful. - * - * @param {Event} event - * - * @return {undefined} - */ - interact(event) { - event.preventDefault(); - - this.ajaxPost(event.target); - - // @todo This probably should be done with IDs. - document.querySelectorAll(`.${event.target.dataset.id}`) - .forEach(node => this.addRemoveClass( - node, - 'hidden', - node.className.indexOf('hidden') == -1 - )); - } - /** * Show or hide menus. * @@ -260,6 +236,30 @@ let BookWyrm = new class { }, 0); } + /** + * Make a request and update the UI accordingly. + * This function is used for boosts and favourites. + * + * @todo Only update status if the promise is successful. + * + * @param {Event} event + * + * @return {undefined} + */ + interact(event) { + event.preventDefault(); + + this.ajaxPost(event.target); + + // @todo This probably should be done with IDs. + document.querySelectorAll(`.${event.target.dataset.id}`) + .forEach(node => this.addRemoveClass( + node, + 'hidden', + node.className.indexOf('hidden') == -1 + )); + } + /** * Submit a form using POST. *