@@ -47,7 +47,7 @@ export class DirectorsBoard extends _AppBase {
|
||||
id: 'scrying-pool-directors-board',
|
||||
classes: ['scrying-pool', 'directors-board'],
|
||||
window: { title: "Director's Board", resizable: true },
|
||||
position: { width: 420, height: 480 },
|
||||
position: { width: 420, height: 480, left: 20, top: 100 },
|
||||
};
|
||||
|
||||
static PARTS = {
|
||||
|
||||
@@ -3,16 +3,41 @@
|
||||
* Scrying Pool Settings Application
|
||||
* Provides a settings panel with a button to reopen the strip
|
||||
*/
|
||||
export class ScryingPoolSettings extends foundry.applications.api.ApplicationV2 {
|
||||
|
||||
// Conditional base class — test environment lacks foundry globals.
|
||||
const _AppBase =
|
||||
typeof foundry !== 'undefined' &&
|
||||
foundry.applications?.api?.HandlebarsApplicationMixin &&
|
||||
foundry.applications?.api?.ApplicationV2
|
||||
? foundry.applications.api.HandlebarsApplicationMixin(
|
||||
foundry.applications.api.ApplicationV2
|
||||
)
|
||||
: class _FallbackApp {
|
||||
static DEFAULT_OPTIONS = {};
|
||||
static PARTS = {};
|
||||
constructor(options = {}) { this.options = options; }
|
||||
get rendered() { return this._rendered ?? false; }
|
||||
set rendered(v) { this._rendered = v; }
|
||||
get element() { return this._element ?? null; }
|
||||
set element(v) { this._element = v; }
|
||||
async render() { this._rendered = true; }
|
||||
async close() { this._rendered = false; }
|
||||
async _prepareContext() { return {}; }
|
||||
_onRender() {}
|
||||
_onClose() {}
|
||||
_onPosition() {}
|
||||
};
|
||||
|
||||
export class ScryingPoolSettings extends _AppBase {
|
||||
static DEFAULT_OPTIONS = {
|
||||
id: 'scrying-pool-settings',
|
||||
classes: ['scrying-pool-settings'],
|
||||
classes: ['scrying-pool', 'scrying-pool-settings'],
|
||||
window: { title: 'Scrying Pool Settings', resizable: true },
|
||||
position: { width: 400, height: 200 },
|
||||
position: { width: 320, height: 200 },
|
||||
};
|
||||
|
||||
static PARTS = {
|
||||
form: {
|
||||
content: {
|
||||
template: 'modules/scrying-pool/templates/settings.hbs',
|
||||
},
|
||||
};
|
||||
@@ -37,6 +62,12 @@ export class ScryingPoolSettings extends foundry.applications.api.ApplicationV2
|
||||
async _onRender(context, options) {
|
||||
super._onRender(context, options);
|
||||
|
||||
// Add click handler for window close button
|
||||
const windowCloseBtn = this.element.querySelector('[data-action="close"]');
|
||||
if (windowCloseBtn) {
|
||||
windowCloseBtn.addEventListener('click', () => this.close());
|
||||
}
|
||||
|
||||
// Add click handler for reopen button
|
||||
const reopenBtn = this.element.querySelector('[data-action="reopen-strip"]');
|
||||
if (reopenBtn) {
|
||||
@@ -46,7 +77,7 @@ export class ScryingPoolSettings extends foundry.applications.api.ApplicationV2
|
||||
});
|
||||
}
|
||||
|
||||
// Add click handler for close button
|
||||
// Add click handler for close strip button
|
||||
const closeBtn = this.element.querySelector('[data-action="close-strip"]');
|
||||
if (closeBtn) {
|
||||
closeBtn.addEventListener('click', () => {
|
||||
|
||||
Reference in New Issue
Block a user