diff --git a/rpg-docs/client/views/character/features/features.js b/rpg-docs/client/views/character/features/features.js index 92a5eb06..ad08dec6 100644 --- a/rpg-docs/client/views/character/features/features.js +++ b/rpg-docs/client/views/character/features/features.js @@ -57,7 +57,7 @@ Template.features.helpers({ return removeDuplicateProficiencies(profs); }, hasCharacters: function(string){ - return string.match(/\S/); + return string && string.match(/\S/); }, }); diff --git a/rpg-docs/client/views/character/spells/spells.js b/rpg-docs/client/views/character/spells/spells.js index 8694b1e7..247445f0 100644 --- a/rpg-docs/client/views/character/spells/spells.js +++ b/rpg-docs/client/views/character/spells/spells.js @@ -291,7 +291,6 @@ Template.spells.events({ Effects.insert(effect); }); - /******[UNCOMMENT ONCE BUFFS ARE ADDED]******* _.each(rawSpell.buffs, (buff) => { buff.charId = charId; buff.parent = {id: spellId, collection: "Spells"}; @@ -314,7 +313,6 @@ Template.spells.events({ Proficiencies.insert(prof); }); }); - *******[UNCOMMENT ONCE BUFFS ARE ADDED]******/ }); }, returnElement: () => $(`[data-id='${spellId}']`).get(0), @@ -384,4 +382,4 @@ Template.layout.events({ Session.set("spellLists.dragSpellId", null); } }, -}); \ No newline at end of file +}); diff --git a/rpg-docs/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.css b/rpg-docs/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.css index 915c5846..64ade5b8 100644 --- a/rpg-docs/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.css +++ b/rpg-docs/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.css @@ -1,7 +1,3 @@ -.spell-library-dialog .spell.selected { - background-color: #e4e4e4; -} - .spell-library-dialog .category-header { font-size: 16px; } @@ -13,11 +9,3 @@ .spell-library-dialog .category-header iron-icon.open { transform: rotate(90deg); } - -.spell-library-dialog table { - border-collapse: collapse; -} - -.spell-library-dialog .library-spell td { - position: relative; -} diff --git a/rpg-docs/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.html b/rpg-docs/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.html index 86972f17..116fd52b 100644 --- a/rpg-docs/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.html +++ b/rpg-docs/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.html @@ -13,13 +13,11 @@
{{#if searchTerm}} {{#if searchSpells.count}} - - - {{#each spell in searchSpells}} - {{>librarySpell spell=spell selected=(isSelected spell)}} - {{/each}} - -
+
+ {{#each spell in searchSpells}} + {{>librarySpell spell=spell selected=(isSelected spell)}} + {{/each}} +
{{else}}{{#if searchReady}} No spells match "{{searchTerm}}" {{/if}}{{/if}} @@ -36,13 +34,11 @@ {{name}}
- - - {{#each spell in (spellsInCategory key)}} - {{>librarySpell spell=spell selected=(isSelected spell)}} - {{/each}} - -
+
+ {{#each spell in (spellsInCategory key)}} + {{>librarySpell spell=spell selected=(isSelected spell)}} + {{/each}} +
{{#unless ready key}} {{/unless}} @@ -59,10 +55,10 @@ diff --git a/rpg-docs/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.js b/rpg-docs/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.js index 9f9cab15..c8cab1d2 100644 --- a/rpg-docs/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.js +++ b/rpg-docs/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.js @@ -62,6 +62,10 @@ Template.spellLibraryDialog.helpers({ const selected = Template.instance().selectedSpells.get(); return _.contains(selected, spell._id); }, + selectedCount(){ + const selected = Template.instance().selectedSpells.get(); + return selected && selected.length; + }, isOpen(key){ const cats = Template.instance().categoriesOpen.get(); return _.contains(cats, key); @@ -109,10 +113,6 @@ Template.spellLibraryDialog.events({ selected.push(spellId); } template.selectedSpells.set(selected); - - - console.log("selectedSpells", Template.instance().selectedSpells.get()); - console.log("spellId", this.spell._id); }, "click #backButton": function(event, template){ popDialogStack();