Skip to content

Commit

Permalink
tooltip on top near bottom of store and trading post
Browse files Browse the repository at this point in the history
  • Loading branch information
jgblight committed Dec 11, 2016
1 parent 0f50adc commit 3ae7ee1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions script/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,8 @@ var Room = {
$('div.storeRow', stores).each(function(index, el) {
el = $(el);
$('div.tooltip', el).remove();
var tt = $('<div>').addClass('tooltip bottom right');
var ttPos = index > 10 ? 'top right' : 'bottom right';
var tt = $('<div>').addClass('tooltip ' + ttPos);
var storeName = el.attr('id').substring(4).replace('-', ' ');
for(var incomeSource in $SM.get('income')) {
var income = $SM.get('income["'+incomeSource+'"]');
Expand Down Expand Up @@ -1117,7 +1118,8 @@ var Room = {
cost: good.cost(),
text: _(k),
click: Room.buy,
width: '80px'
width: '80px',
ttPos: buySection.children().length > 10 ? 'top right' : 'bottom right'
}).css('opacity', 0).attr('buildThing', k).appendTo(buySection).animate({opacity:1}, 300, 'linear');
}
} else {
Expand Down Expand Up @@ -1152,7 +1154,8 @@ var Room = {
},

compassTooltip: function(direction){
var tt = $('<div>').addClass('tooltip bottom right');
var ttPos = $('div#resources').children().length > 10 ? 'top right' : 'bottom right';
var tt = $('<div>').addClass('tooltip ' + ttPos);
$('<div>').addClass('row_key').text(_('the compass points '+ direction)).appendTo(tt);
tt.appendTo($('#row_compass'));
},
Expand Down

0 comments on commit 3ae7ee1

Please sign in to comment.