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.
This commit is contained in:
Andrea Rendine
2015-05-13 14:23:25 +02:00
committed by Blake Grotewold
parent 94936f118d
commit ebf5e6934e
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -431,7 +431,7 @@ var Outside = {
}
if(needsAppend && village.children().length > 1) {
village.appendTo('#outsidePanel');
village.prependTo('#outsidePanel');
village.animate({opacity:1}, 300, 'linear');
}
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -511,7 +511,7 @@ var Room = {
}).appendTo('div#roomPanel');
// Create the stores container
$('<div>').attr('id', 'storesContainer').appendTo('div#roomPanel');
$('<div>').attr('id', 'storesContainer').prependTo('div#roomPanel');
//subscribe to stateUpdates
$.Dispatch('stateUpdate').subscribe(Room.handleStateUpdates);