From 3bde7a5e97327fea6fe0718d0cb9ae0998030656 Mon Sep 17 00:00:00 2001 From: Thaum Date: Fri, 6 Feb 2015 08:58:32 +0000 Subject: [PATCH] Item plural now shows whenever quantity is not 1 --- rpg-docs/Model/Inventory/Items.js | 2 +- .../views/character/inventory/itemDialog/itemDialog.html | 2 +- .../views/character/inventory/itemDialog/itemDialog.js | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rpg-docs/Model/Inventory/Items.js b/rpg-docs/Model/Inventory/Items.js index c316f573..b63b8eec 100644 --- a/rpg-docs/Model/Inventory/Items.js +++ b/rpg-docs/Model/Inventory/Items.js @@ -27,7 +27,7 @@ Items.helpers({ return this.weight * this.quantity; }, pluralName: function(){ - if(this.plural && this.quantity > 1){ + if(this.plural && this.quantity !== 1){ return this.plural; } else{ return this.name; diff --git a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html index 470d3a89..00e167b0 100644 --- a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html +++ b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html @@ -14,7 +14,7 @@
- {{# if quantity}}{{/if}} + {{# if ne1 quantity}}{{/if}} {{# if canEquip}}
diff --git a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.js b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.js index 01254e10..b31804e6 100644 --- a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.js +++ b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.js @@ -116,5 +116,8 @@ Template.itemDialog.helpers({ }, canEquip: function(){ return this.equipmentSlot !== "none"; + }, + ne1: function(num){ + return num != 1; } -}); \ No newline at end of file +});