= this.countAll) return;
this._subs['slotFillers'].setData('limit', this.currentLimit + 50);
},
- insert(){
- if (!this.selectedNode) return;
- this.$store.dispatch('popDialogStack', this.selectedNode);
- },
openPropertyDetails(id){
this.$store.commit('pushDialogStack', {
component: 'library-node-dialog',
@@ -281,14 +274,17 @@ export default {
node._disabledByQuantityFilled &&
!this.selectedNodeIds.includes(node._id)
)
- }
+ },
},
meteor: {
$subscribe: {
'slotFillers'(){
- return [this.slotId]
+ return [this.slotId, this.searchValue || undefined]
},
},
+ searchLoading(){
+ return !!this.searchValue && !this.$subReady.slotFillers;
+ },
model(){
if (this.slotId){
return CreatureProperties.findOne(this.slotId);
@@ -359,8 +355,6 @@ export default {
sort: {name: 1, order: 1}
}).fetch();
let disabledNodeCount = 0;
- let activeNodeCount = 0;
- let lastActiveNodeId = undefined;
// Mark slotFillers whose condition isn't met or are too big to fit
// the quantity to fill
nodes.forEach(node => {
@@ -384,23 +378,8 @@ export default {
if (this.alreadyAdded.has(node._id)){
node._disabledByAlreadyAdded = true;
}
- if (
- !node._disabledBySlotFillerCondition &&
- !node._disabledByQuantityFilled &&
- !node._disabledByAlreadyAdded
- ){
- activeNodeCount += 1;
- lastActiveNodeId = node._id;
- }
});
this.disabledNodeCount = disabledNodeCount;
- if (
- activeNodeCount === 1 &&
- this.$subReady.slotFillers &&
- this.currentLimit >= this.countAll
- ) {
- this.selectedNodeIds = [lastActiveNodeId]
- }
return nodes;
},
}