Skip to content
Browse files

fixed: context menu doesn't show in View Source window

  • Loading branch information...
1 parent 45f9f98 commit 2553a7a9847f11995217ab50789927a176df6f95 @gomita committed Mar 7, 2012
Showing with 12 additions and 10 deletions.
  1. +12 −10 components/xdGestureHandler.js
View
22 components/xdGestureHandler.js
@@ -373,17 +373,19 @@ xdGestureHandler.prototype = {
},
_displayContextMenu: function FGH__displayContextMenu(event) {
- // this fixes the problem: the list of alternative words doesn't display in the context menu
- // when right-clicking on a misspelled word, because of a wrong value of |document.popupRangeOffset|.
- with (this._drawArea.ownerDocument.defaultView) {
- if (!nsContextMenu.prototype._setTargetInternal) {
- nsContextMenu.prototype._setTargetInternal = nsContextMenu.prototype.setTarget;
- nsContextMenu.prototype.setTarget = function(aNode, aRangeParent, aRangeOffset) {
- this._setTargetInternal(aNode, aRangeParent, this._rangeOffset);
- };
- log("*** REPLACED nsContextMenu.prototype.setTarget"); // #debug
+ if ("nsContextMenu" in this._drawArea.ownerDocument.defaultView) {
+ // this fixes the problem: the list of alternative words doesn't display in the context menu
+ // when right-clicking on a misspelled word, because of a wrong value of |document.popupRangeOffset|.
+ with (this._drawArea.ownerDocument.defaultView) {
+ if (!nsContextMenu.prototype._setTargetInternal) {
+ nsContextMenu.prototype._setTargetInternal = nsContextMenu.prototype.setTarget;
+ nsContextMenu.prototype.setTarget = function(aNode, aRangeParent, aRangeOffset) {
+ this._setTargetInternal(aNode, aRangeParent, this._rangeOffset);
+ };
+ log("*** REPLACED nsContextMenu.prototype.setTarget"); // #debug
+ }
+ nsContextMenu.prototype._rangeOffset = event.rangeOffset;
}
- nsContextMenu.prototype._rangeOffset = event.rangeOffset;
}
this._enableContextMenu(true);
// open the context menu artificially

0 comments on commit 2553a7a

Please sign in to comment.
Something went wrong with that request. Please try again.