click on flag bugfix

This commit is contained in:
George Hotz 2014-08-18 17:25:30 -07:00
parent 1ad9ca9029
commit 344a029430
1 changed files with 9 additions and 6 deletions

View File

@ -73,12 +73,15 @@ Meteor.startup(function() {
ee.scrollLeft += e.wheelDelta;
});
function get_addr(e) {
var t = $(e.target);
if (t.hasClass("pchunk")) {
var addr = fhex(t.attr('id').split("_")[1]);
var relX = ((e.pageX - t.offset().left)*1.0)/(t.width());
addr += Math.floor(relX*PAGE_SIZE);
return addr
var tt = [$(e.target), $(e.target).parent()];
for (i in tt) {
var t = tt[i];
if (t.hasClass("pchunk")) {
var addr = fhex(t.attr('id').split("_")[1]);
var relX = ((e.pageX - t.offset().left)*1.0)/(t.width());
addr += Math.floor(relX*PAGE_SIZE);
return addr
}
}
return undefined;
}