Implemented a javascript code style

This commit is contained in:
Stefan Zermatten
2015-04-22 12:44:25 +02:00
parent dce20375b5
commit fada0f5136
113 changed files with 1614 additions and 1650 deletions

View File

@@ -1,27 +1,28 @@
Template.splitStackDialog.helpers({
quantity: function(){
var item = Items.findOne(this.id);
if(item) return Math.round(item.quantity/2);
if (item) return Math.round(item.quantity / 2);
}
});
Template.splitStackDialog.events({
'tap #moveButton': function(event, instance){
"tap #moveButton": function(event, instance){
var item = Items.findOne(this.id);
if(item){
if (item){
item.splitToParent(
{collection: this.parentCollection , id: this.parentId},
+instance.find('#quantityInput').value
{collection: this.parentCollection , id: this.parentId},
+instance.find("#quantityInput").value
);
}
},
'tap #oneButton':function(event, instance){
instance.find('#quantityInput').value = 1;
"tap #oneButton":function(event, instance){
instance.find("#quantityInput").value = 1;
},
'tap #halfButton':function(event, instance){
instance.find('#quantityInput').value = Math.round(Items.findOne(this.id).quantity/2);
"tap #halfButton":function(event, instance){
var val = Math.round(Items.findOne(this.id).quantity / 2);
instance.find("#quantityInput").value = val;
},
"tap #allButton":function(event, instance){
instance.find("#quantityInput").value = Items.findOne(this.id).quantity;
},
'tap #allButton':function(event, instance){
instance.find('#quantityInput').value = Items.findOne(this.id).quantity;
}
});