Popup submenus to left if going offscreen.
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 18 Sep 2009 21:45:30 +0000 (15:45 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 21 Sep 2009 18:56:02 +0000 (12:56 -0600)
imp/js/ContextSensitive.js

index 58db41c..743cf64 100644 (file)
@@ -254,7 +254,9 @@ var ContextSensitive = Class.create({
             y = v.height - size.height - 10;
         }
         if ((x + size.width) > v.width) {
-            x = v.width - size.width - 10;
+            x = this.current.size()
+                ? ($(this.current.last()).viewportOffset()[0] - size.width)
+                : (v.width - size.width - 10);
         }
 
         if (this.opts.onShow) {