0.4.3b 11-Mar-2020
- Changed Reset Filters prompt to be consistent - Fully fixed Issue #4 (filters still showing after reset) compendium-browser.js - Clear all filters to match displayed *-browser.html - Substitute more localization tags template.html - Fixed unlisted bug for content (repeated #if showSpellBrowser) en.json - Add localization for "Reset Filters" promptv0.3.1-spetzel2020 v0.4.3
parent
d7d8e85e3c
commit
1679b50859
|
@ -35,6 +35,7 @@
|
|||
10-Mar-2021 0.4.3: activateItemListListeners(): Remove spurious li.parents (wasn't being used anyway)
|
||||
11-Mar-2021 0.4.3 Fixed: Reset Filters doesn't clear the on-screen filter fields (because it is not completely re-rendering like it used to) Issue #4
|
||||
Hack solution is to re-render whole dialog which unfortunately loses filter settings on other tabs as well
|
||||
0.4.3b: Clear all filters to match displayed
|
||||
*/
|
||||
|
||||
const CMPBrowser = {
|
||||
|
@ -250,22 +251,23 @@ class CompendiumBrowser extends Application {
|
|||
this.triggerSort(html, "npc");
|
||||
|
||||
// reset filters and re-render
|
||||
//0.4.3: Reset ALL filters because when we do a re-render it affects all tabs
|
||||
html.find('#reset-spell-filter').click(ev => {
|
||||
this.spellFilters.activeFilters = {};
|
||||
this.resetFilters();
|
||||
//v0.4.3: Re-render so that we display the filters correctly
|
||||
this.refreshList = "spell";
|
||||
this.render();
|
||||
});
|
||||
|
||||
html.find('#reset-feat-filter').click(ev => {
|
||||
this.featFilters.activeFilters = {};
|
||||
this.resetFilters();
|
||||
//v0.4.3: Re-render so that we display the filters correctly
|
||||
this.refreshList = "feat";
|
||||
this.render();
|
||||
});
|
||||
|
||||
html.find('#reset-item-filter').click(ev => {
|
||||
this.itemFilters.activeFilters = {};
|
||||
this.resetFilters();
|
||||
//v0.4.3: Re-render so that we display the filters correctly
|
||||
this.refreshList = "item";
|
||||
this.render();
|
||||
|
@ -273,7 +275,7 @@ class CompendiumBrowser extends Application {
|
|||
});
|
||||
|
||||
html.find('#reset-npc-filter').click(ev => {
|
||||
this.npcFilters.activeFilters = {};
|
||||
this.resetFilters();
|
||||
//v0.4.3: Re-render so that we display the filters correctly
|
||||
this.refreshList = "npc";
|
||||
this.render();
|
||||
|
@ -765,7 +767,8 @@ class CompendiumBrowser extends Application {
|
|||
|
||||
/* Hook to load the first data */
|
||||
static afterRender(cb, html) {
|
||||
//0.4.3 afterRender is a render hook,but we call it just for the tab when we're just re-rendering for filters
|
||||
//0.4.3: Because a render always resets ALL the displayed filters (on all tabs) to unselected , we have to blank all the lists as well
|
||||
// (because the current HTML template doesn't set the selected filter values)
|
||||
if (!cb?.refreshList) {return;}
|
||||
|
||||
cb.replaceList(html, cb.refreshList);
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
"CMPBrowser.SETTING.Maxload.NAME" : "Maximum load",
|
||||
"CMPBrowser.SETTING.Maxload.HINT" : "Maximum number of spells, feats, items, or NPCs to display; to see more use the filters. This setting is to allow manageing memory and server load.",
|
||||
"CMPBrowser.LOADING.Message" : "Loaded...{numLoaded} {itemType}s",
|
||||
"CMPBrowser.LOADING.MaxLoaded" : "(maximum displayed; to see more, use the filters)"
|
||||
"CMPBrowser.LOADING.MaxLoaded" : "(maximum displayed; to see more, use the filters)",
|
||||
"CMPBrowser.Filters.ResetFilters" : "Reset Filters"
|
||||
|
||||
}
|
|
@ -8,10 +8,10 @@
|
|||
<dt>{{localize "CMPBrowser.sortBy"}}:</dt>
|
||||
<dd><select class="null" name="sortorder">
|
||||
<option value="true" selected>{{localize "Name"}}</option>
|
||||
<option value="false">Class</option>
|
||||
<option value="false">{{localize "DND5E.ItemTypeClass"}}</option>
|
||||
</select></dd>
|
||||
</dl>
|
||||
<button id="reset-feat-filter">Reset Filters</button>
|
||||
<button id="reset-feat-filter">{{localize "CMPBrowser.Filters.ResetFilters"}}</button>
|
||||
</div>
|
||||
{{> "modules/compendium-browser/template/filter-container.html" filters=featFilters}}
|
||||
</div>
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
<dt>{{localize "CMPBrowser.sortBy"}}:</dt>
|
||||
<dd><select class="null" name="sortorder">
|
||||
<option value="true" selected>{{localize "Name"}}</option>
|
||||
<option value="false">Item Type</option>
|
||||
<option value="false">{{localize "DND5E.Type"}}</option>
|
||||
</select></dd>
|
||||
</dl>
|
||||
<button id="reset-item-filter">Reset Filters</button>
|
||||
<button id="reset-item-filter">{{localize "CMPBrowser.Filters.ResetFilters"}}</button>
|
||||
</div>
|
||||
{{> "modules/compendium-browser/template/filter-container.html" filters=itemFilters}}
|
||||
</div>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<option value="size">{{localize "DND5E.Size"}}</option>
|
||||
</select></dd>
|
||||
</dl>
|
||||
<button id="reset-npc-filter">Reset NPC Filters</button>
|
||||
<button id="reset-npc-filter">{{localize "CMPBrowser.Filters.ResetFilters"}}</button>
|
||||
</div>
|
||||
{{> "modules/compendium-browser/template/filter-container.html" filters=npcFilters}}
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<option value="false">{{localize "CMPBrowser.lvl"}}</option>
|
||||
</select></dd>
|
||||
</dl>
|
||||
<button id="reset-spell-filter">Reset Spell Filters</button>
|
||||
<button id="reset-spell-filter">{{localize "CMPBrowser.Filters.ResetFilters"}}</button>
|
||||
</div>
|
||||
{{> "modules/compendium-browser/template/filter-container.html" filters=spellFilters}}
|
||||
</div>
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
<div class="content">
|
||||
<div class="tab" data-tab="spell">{{#if showSpellBrowser}}{{> "modules/compendium-browser/template/spell-browser.html"}}{{/if}}</div>
|
||||
<div class="tab" data-tab="feat">{{#if showSpellBrowser}}{{> "modules/compendium-browser/template/feat-browser.html"}}{{/if}}</div>
|
||||
<div class="tab" data-tab="item">{{#if showSpellBrowser}}{{> "modules/compendium-browser/template/item-browser.html"}}{{/if}}</div>
|
||||
<div class="tab" data-tab="feat">{{#if showFeatBrowser}}{{> "modules/compendium-browser/template/feat-browser.html"}}{{/if}}</div>
|
||||
<div class="tab" data-tab="item">{{#if showItemBrowser}}{{> "modules/compendium-browser/template/item-browser.html"}}{{/if}}</div>
|
||||
<div class="tab" data-tab="npc">{{#if showNpcBrowser}} {{> "modules/compendium-browser/template/npc-browser.html"}}{{/if}}</div>
|
||||
<div class="tab" data-tab="setting">{{#if isGM}} {{> "modules/compendium-browser/template/settings.html"}}{{/if}}</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue