Added carried checkboxes to containers
This commit is contained in:
@@ -23,12 +23,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*To change the ink color for checked state:*/
|
/*To change the ink color for checked state:*/
|
||||||
paper-checkbox.enabledCheckbox::shadow #ink[checked] {
|
.containerTop paper-checkbox::shadow #ink[checked] {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*To change the checkbox checked color:*/
|
/*To change the checkbox checked color:*/
|
||||||
paper-checkbox.enabledCheckbox::shadow #checkbox.checked {
|
.containerTop paper-checkbox::shadow #checkbox.checked {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
background-color: rgba(255,255,255,0.27);
|
background-color: rgba(255,255,255,0.27);
|
||||||
border-color: #ffffff;
|
border-color: #ffffff;
|
||||||
@@ -36,22 +36,22 @@ paper-checkbox.enabledCheckbox::shadow #checkbox.checked {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*ensure the checkmark is shown when ticked*/
|
/*ensure the checkmark is shown when ticked*/
|
||||||
paper-checkbox.enabledCheckbox::shadow #checkbox.checked #checkmark {
|
.containerTop paper-checkbox::shadow #checkbox.checked #checkmark {
|
||||||
display: initial;
|
display: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*To change the ink color for unchecked state:*/
|
/*To change the ink color for unchecked state:*/
|
||||||
paper-checkbox.enabledCheckbox::shadow #ink {
|
.containerTop paper-checkbox::shadow #ink {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*To change the checkbox unchecked color:*/
|
/*To change the checkbox unchecked color:*/
|
||||||
paper-checkbox.enabledCheckbox::shadow #checkbox {
|
.containerTop paper-checkbox::shadow #checkbox {
|
||||||
border-color: #ffffff;
|
border-color: #ffffff;
|
||||||
border-color: rgba(255,255,255,0.54);
|
border-color: rgba(255,255,255,0.54);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ensure checkmark isn't shown early*/
|
/*ensure checkmark isn't shown early*/
|
||||||
paper-checkbox.enabledCheckbox::shadow #checkbox #checkmark {
|
.containerTop paper-checkbox::shadow #checkbox #checkmark {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,10 @@
|
|||||||
<div class="containerTop {{colorClass}}" hero-id="toolbar" layout horizontal center {{detailHero}}>
|
<div class="containerTop {{colorClass}}" hero-id="toolbar" layout horizontal center {{detailHero}}>
|
||||||
<div class="containerName subhead" hero-id="title" flex {{detailHero}}>{{name}}</div>
|
<div class="containerName subhead" hero-id="title" flex {{detailHero}}>{{name}}</div>
|
||||||
<div class="caption" style="margin-right: 8px">{{valueString totalValue}}</div>
|
<div class="caption" style="margin-right: 8px">{{valueString totalValue}}</div>
|
||||||
<div class="caption">{{round totalWeight}}lbs</div>
|
<div class="caption" style="margin-right: 8px">{{round totalWeight}}lbs</div>
|
||||||
|
<core-tooltip label="Container carried" position="left">
|
||||||
|
<paper-checkbox class="carriedCheckbox" checked={{isCarried}}></paper-checkbox>
|
||||||
|
</core-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div flex class="containerMain">
|
<div flex class="containerMain">
|
||||||
{{#each items ../_id _id}}
|
{{#each items ../_id _id}}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Template.inventory.helpers({
|
|||||||
Containers.find({charId: this._id, isCarried: true}).forEach(function(container){
|
Containers.find({charId: this._id, isCarried: true}).forEach(function(container){
|
||||||
weight += container.totalWeight();
|
weight += container.totalWeight();
|
||||||
});
|
});
|
||||||
Items.find({charId: this._id, equipped: false}, {fields: {weight : 1, quantity: 1}}).forEach(function(item){
|
Items.find({charId: this._id, equipped: true}, {fields: {weight : 1, quantity: 1}}).forEach(function(item){
|
||||||
weight += item.totalWeight();
|
weight += item.totalWeight();
|
||||||
});
|
});
|
||||||
return weight;
|
return weight;
|
||||||
@@ -94,6 +94,15 @@ Template.inventory.events({
|
|||||||
data: {containerId: this._id, charId: this.charId},
|
data: {containerId: this._id, charId: this.charId},
|
||||||
heroId: this._id
|
heroId: this._id
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
"tap .carriedCheckbox": function(event){
|
||||||
|
event.stopPropagation();
|
||||||
|
},
|
||||||
|
"change .carriedCheckbox": function(event){
|
||||||
|
var carried;
|
||||||
|
if(this.isCarried) carried = false;
|
||||||
|
else carried = true;
|
||||||
|
Containers.update(this._id, {$set: {isCarried: carried}});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user