-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathtile-history.js
49 lines (42 loc) · 1.43 KB
/
tile-history.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { MonksActiveTiles, log, setting, i18n, makeid } from '../monks-active-tiles.js';
export class TileHistory extends FormApplication {
constructor(object, options = {}) {
super(object, options);
}
/** @inheritdoc */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
id: "tile-history",
classes: ["form", "action-sheet"],
title: "MonksActiveTiles.TileHistory",
template: "modules/monks-active-tiles/templates/tile-history.html",
width: 700,
height: 'auto'
});
}
getData(options) {
let history = this.object.getHistory();
return foundry.utils.mergeObject(super.getData(options), {
history: history
});
}
activateListeners(html) {
super.activateListeners(html);
let that = this;
$('.item-delete', html).click(function () {
let row = $(this).closest('.item');
let id = row[0].dataset.id;
that.object.removeHistory(id);
row.remove();
that.setPosition();
});
$('button[name="reset"]', html).click(function () {
that.object.resetHistory();
$('.item-list', html).empty();
that.setPosition();
});
}
async _updateObject(event, formData) {
log('updating action', event, formData, this.object);
}
}