Skip to content

Commit

Permalink
Correct DOM positions for village, store, perks box
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AndySky21 authored and groteworld committed May 13, 2015
1 parent 94936f1 commit ebf5e69
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion script/outside.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ var Outside = {
}

if(needsAppend && village.children().length > 1) {
village.appendTo('#outsidePanel');
village.prependTo('#outsidePanel');
village.animate({opacity:1}, 300, 'linear');
}

Expand Down
2 changes: 1 addition & 1 deletion script/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion script/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ebf5e69

Please sign in to comment.