Element checks
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 9 Apr 2009 05:31:30 +0000 (23:31 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 9 Apr 2009 05:31:30 +0000 (23:31 -0600)
imp/js/src/ContextSensitive.js

index ec601e6..49020f0 100644 (file)
@@ -145,10 +145,14 @@ var ContextSensitive = Class.create({
             elt = e.element();
             if (!elt.match('A')) {
                 elt = elt.up('A');
+                if (!elt) {
+                    this._rightClickHandler(e, true);
+                    return;
+                }
             }
             elt_up = elt.up();
 
-            if (elt_up.hasClassName('contextMenu')) {
+            if (elt_up && elt_up.hasClassName('contextMenu')) {
                 e.stop();
 
                 if (elt.hasClassName('contextSubmenu') &&