merge two if
This commit is contained in:
@@ -442,8 +442,7 @@ export default class HooksL5r5e {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// If gm add a extra button to easily filter the content to see the same stuff as a player
|
// If gm add a extra button to easily filter the content to see the same stuff as a player
|
||||||
if(game.user.isGM) {
|
if (game.user.isGM && unavailableSourceForPlayers.length > 0) {
|
||||||
if(unavailableSourceForPlayers.length > 0) {
|
|
||||||
const buttonHTML = `<button type="button" class="gm" data-tooltip="${game.i18n.localize('l5r5e.multiselect.player_filter_tooltip')}">`
|
const buttonHTML = `<button type="button" class="gm" data-tooltip="${game.i18n.localize('l5r5e.multiselect.player_filter_tooltip')}">`
|
||||||
+ game.i18n.localize('l5r5e.multiselect.player_filter_label')
|
+ game.i18n.localize('l5r5e.multiselect.player_filter_label')
|
||||||
+ '</button>'
|
+ '</button>'
|
||||||
@@ -451,12 +450,12 @@ export default class HooksL5r5e {
|
|||||||
const filterPlayerView = game.settings.get(CONFIG.l5r5e.namespace, "all-compendium-references")
|
const filterPlayerView = game.settings.get(CONFIG.l5r5e.namespace, "all-compendium-references")
|
||||||
.filter((item) => !unavailableSourceForPlayers.includes(item))
|
.filter((item) => !unavailableSourceForPlayers.includes(item))
|
||||||
.filter((item) => sources_in_this_compendium.has(item));
|
.filter((item) => sources_in_this_compendium.has(item));
|
||||||
|
|
||||||
$(buttonHTML).appendTo($(header).find("l5r5e-multi-select")).click(function() {
|
$(buttonHTML).appendTo($(header).find("l5r5e-multi-select")).click(function() {
|
||||||
header.find("l5r5e-multi-select")[0].value = filterPlayerView;
|
header.find("l5r5e-multi-select")[0].value = filterPlayerView;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// TODO find a better way
|
// TODO find a better way
|
||||||
// This is ugly but if we hide the content too early then it won't be hidden for some reason.
|
// This is ugly but if we hide the content too early then it won't be hidden for some reason.
|
||||||
|
|||||||
Reference in New Issue
Block a user