Author: eallen
Date: 2009-03-31 09:31:54 -0400 (Tue, 31 Mar 2009)
New Revision: 3244
Modified:
mgmt/trunk/cumin/python/cumin/visualizations.strings
Log:
Prevent slot info popup from showing above the top of the page.
Modified: mgmt/trunk/cumin/python/cumin/visualizations.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/visualizations.strings 2009-03-31 10:06:45 UTC (rev
3243)
+++ mgmt/trunk/cumin/python/cumin/visualizations.strings 2009-03-31 13:31:54 UTC (rev
3244)
@@ -606,13 +606,22 @@
var y = Math.floor(args.index / slot_map_info.cols) * slot_map_info.size
+ slot_clip_top;
// candidate pos for popup
- var top = (abs_pos.y + y) + Math.floor(slot_map_info.size * 1.5);
-
+ // just under the clicked slot
+ var topUnder = (abs_pos.y + y) + Math.floor(slot_map_info.size * 1.5);
+ var top = topUnder;
+
// if off the bottom of the map
- if (top + oInfo.offsetHeight > abs_pos.y + oMap.offsetHeight) {
+ if (topUnder + oInfo.offsetHeight > abs_pos.y + oMap.offsetHeight) {
// position popup above clicked slot
top = (abs_pos.y + y) - oInfo.offsetHeight -
Math.floor(slot_map_info.size * .5);
}
+
+ // if off the top of the page
+ if (top < 0) {
+ // revert to under the item
+ top = topUnder;
+ }
+
oInfo.style.top = top + "px";
oInfo.style.left = abs_pos.x + "px";
}
Show replies by date