diff --git a/rpg-docs/Model/Inventory/Containers.js b/rpg-docs/Model/Inventory/Containers.js index 2c92c8de..8ca640fa 100644 --- a/rpg-docs/Model/Inventory/Containers.js +++ b/rpg-docs/Model/Inventory/Containers.js @@ -23,7 +23,7 @@ Containers.helpers({ }, totalWeight: function(){ var weight = this.weight; - Items.find({container: this._id, equipped: false}, {fields: {weight: 1, value: 1}}).forEach(function(item){ + Items.find({container: this._id, equipped: false}, {fields: {quantity: 1, weight: 1}}).forEach(function(item){ weight += item.totalWeight(); }); return weight; diff --git a/rpg-docs/client/globalHelpers/GlobalUI.js b/rpg-docs/client/globalHelpers/GlobalUI.js index e25e4b48..8aeaf85e 100644 --- a/rpg-docs/client/globalHelpers/GlobalUI.js +++ b/rpg-docs/client/globalHelpers/GlobalUI.js @@ -37,7 +37,7 @@ this.GlobalUI = (function() { GlobalUI.showDetail = function(opts) { Session.set("global.ui.detailData", opts.data); Session.set("global.ui.detailTemplate", opts.template); - GlobalUI.detailHero = opts.hero; + Session.set("global.ui.detailHeroId", opts.heroId); Session.set("global.ui.detailShow", true); }; @@ -51,7 +51,7 @@ this.GlobalUI = (function() { GlobalUI.setDetail = function(opts) { Session.set("global.ui.detailData", opts.data); Session.set("global.ui.detailTemplate", opts.template); - GlobalUI.detailHero = opts.hero; + Session.set("global.ui.detailHeroId", opts.heroId); }; GlobalUI.closeDetail = function(){ @@ -108,21 +108,15 @@ Template.layout.events({ } else { Session.set("global.ui.detailData", null); Session.set("global.ui.detailTemplate", null); - //remove the hero attribute - var heroElem = GlobalUI.detailHero; - heroElem && heroElem.attr("hero", null); - heroElem && heroElem.find("[hero-id]").attr("hero", null); - GlobalUI.detailHero = null; + Session.set("global.ui.detailHeroId", null); } }, "core-animated-pages-transition-prepare": function(e) { var detailOpened = Session.get("global.ui.detailShow"); if(detailOpened) { - //add the hero attribute where needed - var heroElem = GlobalUI.detailHero; - heroElem && heroElem.attr("hero", ""); - heroElem && heroElem.find("[hero-id]").attr("hero", ""); + //set up the transition } else { + //undo hack $("#mainContentSection").removeClass("fake-selected"); } }, diff --git a/rpg-docs/client/globalHelpers/detailHero.js b/rpg-docs/client/globalHelpers/detailHero.js new file mode 100644 index 00000000..e3221a64 --- /dev/null +++ b/rpg-docs/client/globalHelpers/detailHero.js @@ -0,0 +1,5 @@ +Template.registerHelper("detailHero", function(){ + if ( Session.equals("global.ui.detailHeroId", this._id) ) { + return "hero"; + } +}); \ No newline at end of file diff --git a/rpg-docs/client/globalHelpers/round.js b/rpg-docs/client/globalHelpers/round.js new file mode 100644 index 00000000..b44ec56d --- /dev/null +++ b/rpg-docs/client/globalHelpers/round.js @@ -0,0 +1,6 @@ +Template.registerHelper("round", function(value, decimalPlaces){ + decimalPlaces = +decimalPlaces || 2; + var num = +value; + var tens = Math.pow(10, decimalPlaces) + return Math.round(num * tens) / tens; +}); \ No newline at end of file diff --git a/rpg-docs/client/views/GeneralCSS/typography.css b/rpg-docs/client/views/GeneralCSS/typography.css index ba8cec3e..5dbcc1f4 100644 --- a/rpg-docs/client/views/GeneralCSS/typography.css +++ b/rpg-docs/client/views/GeneralCSS/typography.css @@ -44,7 +44,7 @@ h2, .title { letter-spacing: 0.005em; } -.white-text h2{ +.white-text h2, .white-text .title, .white-text.title{ color: rgba(255,255,255,0.87); } diff --git a/rpg-docs/client/views/character/features/features.html b/rpg-docs/client/views/character/features/features.html index 4b59e53b..94352ccf 100644 --- a/rpg-docs/client/views/character/features/features.html +++ b/rpg-docs/client/views/character/features/features.html @@ -9,8 +9,8 @@