From ebf5e6934e456d77e4ffe7bef1a7cb16e85d8929 Mon Sep 17 00:00:00 2001 From: Andrea Rendine Date: Wed, 13 May 2015 14:23:25 +0200 Subject: [PATCH] Correct DOM positions for village, store, perks box I noticed a minor glitch with the Village box position in the DOM. As it is appended to the Outside panel, it can end up after the Wood gather button or after the Traps check. It depends on whether the latter exists or not. I changed it a little. Now it is "prepended" (thanks jQuery!), so it's always before any other content in the panel. It would mind e.g. for CSS consistency, as you could decide to use a style for sibling buttons and it wouldn't work unless the box is placed before or after (not between) them. For consistency with Outside box placement issue, stores are prepended to the Room panel, as first content in the DOM tree. For consistency with Outside box placement issue, perks are prepended to the Path panel, as first content in the DOM tree. --- script/outside.js | 2 +- script/path.js | 2 +- script/room.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/outside.js b/script/outside.js index 9372a31..b3b524d 100644 --- a/script/outside.js +++ b/script/outside.js @@ -431,7 +431,7 @@ var Outside = { } if(needsAppend && village.children().length > 1) { - village.appendTo('#outsidePanel'); + village.prependTo('#outsidePanel'); village.animate({opacity:1}, 300, 'linear'); } diff --git a/script/path.js b/script/path.js index d9a8c4a..45d00d9 100644 --- a/script/path.js +++ b/script/path.js @@ -112,7 +112,7 @@ var Path = { } if(needsAppend && perks.children().length > 0) { - perks.appendTo(Path.panel); + perks.prependTo(Path.panel); } if(!ignoreStores && Engine.activeModule === Path) { diff --git a/script/room.js b/script/room.js index 0818b58..b75e3cd 100644 --- a/script/room.js +++ b/script/room.js @@ -511,7 +511,7 @@ var Room = { }).appendTo('div#roomPanel'); // Create the stores container - $('
').attr('id', 'storesContainer').appendTo('div#roomPanel'); + $('
').attr('id', 'storesContainer').prependTo('div#roomPanel'); //subscribe to stateUpdates $.Dispatch('stateUpdate').subscribe(Room.handleStateUpdates);