-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdeck.js
More file actions
23 lines (23 loc) · 876 Bytes
/
deck.js
File metadata and controls
23 lines (23 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
onPage('Decks', function () {
debug('Deck editor');
eventManager.on('jQuery', () => {
$(document).ajaxSuccess((event, xhr, options) => {
if (options.url !== 'DecksConfig') return;
const data = JSON.parse(options.data);
eventManager.emit('Deck:Change', data, options, xhr);
eventManager.emit(`Deck:${data.action}`, data, options, xhr);
});
$(document).ajaxComplete((event, xhr, options) => {
if (options.url !== 'DecksConfig') return;
const data = JSON.parse(options.data);
eventManager.emit('Deck:postChange', data, options, xhr);
eventManager.emit(`Deck:${data.action}`, data, options, xhr);
});
// Class change
$('#selectClasses').change(function () {
// Sometimes it takes too long, so lets change it now
classe = $(this).val();
eventManager.emit('Deck:Soul');
});
});
});