HummingBirdAnimeClient/public/js/base/events.js

30 lines
629 B
JavaScript
Raw Normal View History

2016-02-01 09:49:18 -05:00
/**
2016-02-02 11:34:03 -05:00
* Event handlers
2016-02-01 09:49:18 -05:00
*/
2016-02-08 10:57:44 -05:00
((ac) => {
2016-02-01 09:49:18 -05:00
'use strict';
// Close event for messages
2016-02-08 10:57:44 -05:00
ac.on('header', 'click', '.message', function () {
ac.hide(this);
2016-02-01 09:49:18 -05:00
});
// 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();
}
});
2016-04-21 11:14:21 -04:00
// Clear the api cache
ac.on('.js-clear-cache', 'click', function () {
2016-04-21 11:14:21 -04:00
ac.get('/cache_purge', () => {
ac.showMessage('success', `Sucessfully purged api cache`);
});
});
2016-02-08 10:57:44 -05:00
})(AnimeClient);