From f97345e407d3dcc4f2cbaaca15b705f0bfa9584d Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 24 Feb 2023 00:33:49 +0100 Subject: [PATCH] =?UTF-8?q?Fix:=20recherche=20avec=20droits=20limit=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor/base-actor-sheet.js | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/module/actor/base-actor-sheet.js b/module/actor/base-actor-sheet.js index 1412238a..9ac21339 100644 --- a/module/actor/base-actor-sheet.js +++ b/module/actor/base-actor-sheet.js @@ -123,21 +123,27 @@ export class RdDBaseActorSheet extends ActorSheet { .map(t => Misc.arrayOrEmpty(itemTypes[t])) .reduce((a, b) => a.concat(b), []) .sort(Misc.ascending(it => it.name)); - } - - /* -------------------------------------------- */ /** @override */ - activateListeners(html) { - super.activateListeners(html); - this.html = html; - - this.html.find('.conteneur-name a').click(async event => { - RdDUtility.toggleAfficheContenu(this.getItemId(event)); - this.render(true); - }); - this.html.find('.item-edit').click(async event => this.getItem(event)?.sheet.render(true)) - this.html.find('.item-montrer').click(async event => this.getItem(event)?.postItemToChat()); - this.html.find('.actor-montrer').click(async event => this.actor.postActorToChat()); - + } + + /* -------------------------------------------- */ /** @override */ + activateListeners(html) { + super.activateListeners(html); + this.html = html; + + this.html.find('.conteneur-name a').click(async event => { + RdDUtility.toggleAfficheContenu(this.getItemId(event)); + this.render(true); + }); + this.html.find('.item-edit').click(async event => this.getItem(event)?.sheet.render(true)) + this.html.find('.item-montrer').click(async event => this.getItem(event)?.postItemToChat()); + this.html.find('.actor-montrer').click(async event => this.actor.postActorToChat()); + this.html.find('.recherche') + .each((index, field) => { + this._rechercheSelectArea(field); + }) + .keyup(async event => this._rechercherKeyup(event)) + .change(async event => this._rechercherKeyup(event)); + this.html.find('.recherche').prop( "disabled", false ); // Everything below here is only needed if the sheet is editable if (!this.options.editable) return; @@ -160,12 +166,6 @@ export class RdDBaseActorSheet extends ActorSheet { this.html.find('.monnaie-moins').click(async event => { this.actor.monnaieIncDec(this.getItemId(event), -1); }); - this.html.find('.recherche') - .each((index, field) => { - this._rechercheSelectArea(field); - }) - .keyup(async event => this._rechercherKeyup(event)) - .change(async event => this._rechercherKeyup(event)); } _rechercherKeyup(event) {