Add files via upload
fixed an issue that prevented the rendering of the Button to open the browserv0.2.1
parent
9b28605ab5
commit
7f9a113815
|
@ -52,23 +52,26 @@ class SpellBrowser extends Application {
|
|||
|
||||
hookCompendiumList() {
|
||||
Hooks.on('renderCompendiumDirectory', (app, html, data) => {
|
||||
if (this.settings === undefined) {
|
||||
this.initSettings();
|
||||
}
|
||||
if (game.user.isGM || this.settings.allowSpellBrowser || this.settings.allowNpcBrowser) {
|
||||
const importButton = $(`<button class="compendium-browser-btn"><i class="fas fa-fire"></i> ${game.i18n.localize("CMPBrowser.compendiumBrowser")}</button>`);
|
||||
html.find('.compendium-browser-btn').remove();
|
||||
|
||||
// adding to directory-list since the footer doesn't exist if the user is not gm
|
||||
html.find('.directory-footer').append(importButton);
|
||||
|
||||
// Handle button clicks
|
||||
importButton.click(ev => {
|
||||
ev.preventDefault();
|
||||
this.render(true);
|
||||
});
|
||||
}
|
||||
this.hookCompendiumList();
|
||||
});
|
||||
|
||||
let html = $('#compendium');
|
||||
if (this.settings === undefined) {
|
||||
this.initSettings();
|
||||
}
|
||||
if (game.user.isGM || this.settings.allowSpellBrowser || this.settings.allowNpcBrowser) {
|
||||
const importButton = $(`<button class="compendium-browser-btn"><i class="fas fa-fire"></i> ${game.i18n.localize("CMPBrowser.compendiumBrowser")}</button>`);
|
||||
html.find('.compendium-browser-btn').remove();
|
||||
|
||||
// adding to directory-list since the footer doesn't exist if the user is not gm
|
||||
html.find('.directory-footer').append(importButton);
|
||||
|
||||
// Handle button clicks
|
||||
importButton.click(ev => {
|
||||
ev.preventDefault();
|
||||
this.render(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async getData() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "compendium-browser",
|
||||
"title": "Compendium Browser",
|
||||
"description": "A module to easily browse and filter spells as well as npcs loaded from compendie.",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"author": "Felix#6196",
|
||||
"systems": ["dnd5e"],
|
||||
"scripts": ["./compendium-browser.js"],
|
||||
|
|
Loading…
Reference in New Issue