Fix clicking on the clhs and crhs elements

This commit is contained in:
Andrew Chin
2013-06-21 17:17:31 -04:00
parent 91f1a2158d
commit cbd61e600d

View File

@@ -1387,13 +1387,13 @@ jQuery.extend(Mgly.mergely.prototype, {
ctx_rhs.fillRect(1.5, from, 4.5, to);
ex.clhs.click(function (ev) {
var y = ev.pageY - lhs_xyoffset.top - (to / 2);
var sto = Math.max(0, (y / ex.mcanvas_lhs.height) * ex.lhs_scroller.get(0).scrollHeight);
var y = ev.pageY - ex.lhs_xyoffset.top - (to / 2);
var sto = Math.max(0, (y / mcanvas_lhs.height) * ex.lhs_scroller.get(0).scrollHeight);
ex.lhs_scroller.scrollTop(sto);
});
ex.crhs.click(function (ev) {
var y = ev.pageY - rhs_xyoffset.top - (to / 2);
var sto = Math.max(0, (y / ex.mcanvas_rhs.height) * ex.rhs_scroller.get(0).scrollHeight);
var y = ev.pageY - ex.rhs_xyoffset.top - (to / 2);
var sto = Math.max(0, (y / mcanvas_rhs.height) * ex.rhs_scroller.get(0).scrollHeight);
ex.rhs_scroller.scrollTop(sto);
});
},