HummingBirdAnimeClient/public/js/base/events.js
Timothy J. Warren 39118d63e5 All basic API functionality:
* Anime List Item:
	* Creation
	* Updating
	* Retreiving
	* Deletion

* Manga List Item:
	* Creation
	* Updating
	* Retreiving
	* Deletion

* Anime detail page
* Manga detail page
2017-01-10 12:35:46 -05:00

30 lines
629 B
JavaScript

/**
* Event handlers
*/
((ac) => {
'use strict';
// Close event for messages
ac.on('header', 'click', '.message', function () {
ac.hide(this);
});
// Confirm deleting of list or library items
ac.on('form.js-delete', 'submit', function (event) {
let proceed = confirm("Are you ABSOLUTELY SURE you want to delete this item?");
if (proceed === false) {
event.preventDefault();
event.stopPropagation();
}
});
// Clear the api cache
ac.on('.js-clear-cache', 'click', function () {
ac.get('/cache_purge', () => {
ac.showMessage('success', `Sucessfully purged api cache`);
});
});
})(AnimeClient);