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() {
|
hookCompendiumList() {
|
||||||
Hooks.on('renderCompendiumDirectory', (app, html, data) => {
|
Hooks.on('renderCompendiumDirectory', (app, html, data) => {
|
||||||
if (this.settings === undefined) {
|
this.hookCompendiumList();
|
||||||
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);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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() {
|
async getData() {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "compendium-browser",
|
"name": "compendium-browser",
|
||||||
"title": "Compendium Browser",
|
"title": "Compendium Browser",
|
||||||
"description": "A module to easily browse and filter spells as well as npcs loaded from compendie.",
|
"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",
|
"author": "Felix#6196",
|
||||||
"systems": ["dnd5e"],
|
"systems": ["dnd5e"],
|
||||||
"scripts": ["./compendium-browser.js"],
|
"scripts": ["./compendium-browser.js"],
|
||||||
|
|
Loading…
Reference in New Issue