HummingBirdAnimeClient/public/js/base/events.js

30 lines
616 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
2017-02-15 16:13:32 -05:00
ac.on('form.js-delete', 'submit', 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
2017-02-15 16:13:32 -05:00
ac.on('.js-clear-cache', 'click', () => {
2016-04-21 11:14:21 -04:00
ac.get('/cache_purge', () => {
2017-02-15 16:13:32 -05:00
ac.showMessage('success', `Successfully purged api cache`);
2016-04-21 11:14:21 -04:00
});
});
2016-02-08 10:57:44 -05:00
})(AnimeClient);