Add files via upload

fixed an issue that prevented the rendering of the Button to open the browser
v0.2.1
Felix 2020-05-18 13:31:14 +02:00 committed by GitHub
parent 9b28605ab5
commit 7f9a113815
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 17 deletions

View File

@ -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() {

View File

@ -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"],