Merge branch 'enhancement-spell-library-style'
This commit is contained in:
@@ -57,7 +57,7 @@ Template.features.helpers({
|
|||||||
return removeDuplicateProficiencies(profs);
|
return removeDuplicateProficiencies(profs);
|
||||||
},
|
},
|
||||||
hasCharacters: function(string){
|
hasCharacters: function(string){
|
||||||
return string.match(/\S/);
|
return string && string.match(/\S/);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -291,7 +291,6 @@ Template.spells.events({
|
|||||||
Effects.insert(effect);
|
Effects.insert(effect);
|
||||||
});
|
});
|
||||||
|
|
||||||
/******[UNCOMMENT ONCE BUFFS ARE ADDED]*******
|
|
||||||
_.each(rawSpell.buffs, (buff) => {
|
_.each(rawSpell.buffs, (buff) => {
|
||||||
buff.charId = charId;
|
buff.charId = charId;
|
||||||
buff.parent = {id: spellId, collection: "Spells"};
|
buff.parent = {id: spellId, collection: "Spells"};
|
||||||
@@ -314,7 +313,6 @@ Template.spells.events({
|
|||||||
Proficiencies.insert(prof);
|
Proficiencies.insert(prof);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
*******[UNCOMMENT ONCE BUFFS ARE ADDED]******/
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
returnElement: () => $(`[data-id='${spellId}']`).get(0),
|
returnElement: () => $(`[data-id='${spellId}']`).get(0),
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
.spell-library-dialog .spell.selected {
|
|
||||||
background-color: #e4e4e4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.spell-library-dialog .category-header {
|
.spell-library-dialog .category-header {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
@@ -13,11 +9,3 @@
|
|||||||
.spell-library-dialog .category-header iron-icon.open {
|
.spell-library-dialog .category-header iron-icon.open {
|
||||||
transform: rotate(90deg);
|
transform: rotate(90deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.spell-library-dialog table {
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
|
|
||||||
.spell-library-dialog .library-spell td {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -13,13 +13,11 @@
|
|||||||
<div class="spells" style="padding:8px">
|
<div class="spells" style="padding:8px">
|
||||||
{{#if searchTerm}}
|
{{#if searchTerm}}
|
||||||
{{#if searchSpells.count}}
|
{{#if searchSpells.count}}
|
||||||
<table style="width: 100%">
|
<div>
|
||||||
<tbody>
|
{{#each spell in searchSpells}}
|
||||||
{{#each spell in searchSpells}}
|
{{>librarySpell spell=spell selected=(isSelected spell)}}
|
||||||
{{>librarySpell spell=spell selected=(isSelected spell)}}
|
{{/each}}
|
||||||
{{/each}}
|
</div>
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
{{else}}{{#if searchReady}}
|
{{else}}{{#if searchReady}}
|
||||||
No spells match "{{searchTerm}}"
|
No spells match "{{searchTerm}}"
|
||||||
{{/if}}{{/if}}
|
{{/if}}{{/if}}
|
||||||
@@ -36,13 +34,11 @@
|
|||||||
{{name}}
|
{{name}}
|
||||||
</div>
|
</div>
|
||||||
<iron-collapse opened={{isOpen key}}>
|
<iron-collapse opened={{isOpen key}}>
|
||||||
<table style="width: 100%">
|
<div>
|
||||||
<tbody>
|
{{#each spell in (spellsInCategory key)}}
|
||||||
{{#each spell in (spellsInCategory key)}}
|
{{>librarySpell spell=spell selected=(isSelected spell)}}
|
||||||
{{>librarySpell spell=spell selected=(isSelected spell)}}
|
{{/each}}
|
||||||
{{/each}}
|
</div>
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
{{#unless ready key}}
|
{{#unless ready key}}
|
||||||
<paper-spinner active></paper-spinner>
|
<paper-spinner active></paper-spinner>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
@@ -59,10 +55,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template name="librarySpell">
|
<template name="librarySpell">
|
||||||
<tr class="spell library-spell {{#if selected}}selected{{/if}}">
|
<div style="margin: ">
|
||||||
<td class="spellName">
|
<paper-checkbox class="spell library-spell" checked={{selected}} style="padding: 2px 0 2px 16px; width: 100%;">
|
||||||
{{spell.name}}
|
{{spell.name}}
|
||||||
<paper-ripple></paper-ripple>
|
<paper-ripple></paper-ripple>
|
||||||
</td>
|
</paper-checkbox>
|
||||||
</tr>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -62,6 +62,10 @@ Template.spellLibraryDialog.helpers({
|
|||||||
const selected = Template.instance().selectedSpells.get();
|
const selected = Template.instance().selectedSpells.get();
|
||||||
return _.contains(selected, spell._id);
|
return _.contains(selected, spell._id);
|
||||||
},
|
},
|
||||||
|
selectedCount(){
|
||||||
|
const selected = Template.instance().selectedSpells.get();
|
||||||
|
return selected && selected.length;
|
||||||
|
},
|
||||||
isOpen(key){
|
isOpen(key){
|
||||||
const cats = Template.instance().categoriesOpen.get();
|
const cats = Template.instance().categoriesOpen.get();
|
||||||
return _.contains(cats, key);
|
return _.contains(cats, key);
|
||||||
@@ -109,10 +113,6 @@ Template.spellLibraryDialog.events({
|
|||||||
selected.push(spellId);
|
selected.push(spellId);
|
||||||
}
|
}
|
||||||
template.selectedSpells.set(selected);
|
template.selectedSpells.set(selected);
|
||||||
|
|
||||||
|
|
||||||
console.log("selectedSpells", Template.instance().selectedSpells.get());
|
|
||||||
console.log("spellId", this.spell._id);
|
|
||||||
},
|
},
|
||||||
"click #backButton": function(event, template){
|
"click #backButton": function(event, template){
|
||||||
popDialogStack();
|
popDialogStack();
|
||||||
|
|||||||
Reference in New Issue
Block a user