From 076c5bb4ffb99b97747d31b097054d2b37e7bce7 Mon Sep 17 00:00:00 2001 From: piro Date: Sun, 27 Jun 2010 13:22:06 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=83=96=E3=83=90=E3=83=BC=E3=82=92?= =?UTF-8?q?=E8=87=AA=E5=8B=95=E7=9A=84=E3=81=AB=E9=9A=A0=E3=81=99=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=81=AE=E6=99=82=E3=80=81=E3=82=BF=E3=83=96=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=81=AE=E9=96=8B=E9=96=89=E3=81=AE=E7=9E=AC=E9=96=93?= =?UTF-8?q?=E3=81=AB=E3=82=B3=E3=83=B3=E3=83=86=E3=83=B3=E3=83=84=E9=A0=98?= =?UTF-8?q?=E5=9F=9F=E3=82=92=E3=82=AF=E3=83=AA=E3=83=83=E3=82=AF=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=A8=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AE=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E3=81=8C=E9=81=B8=E6=8A=9E=E3=81=95=E3=82=8C=E3=81=9F?= =?UTF-8?q?=E7=8A=B6=E6=85=8B=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=97?= =?UTF-8?q?=E3=81=BE=E3=81=86=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6762 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/res/stopRendering.js | 27 ++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/content/treestyletab/res/stopRendering.js b/content/treestyletab/res/stopRendering.js index 8cc8b44e..bcad6833 100644 --- a/content/treestyletab/res/stopRendering.js +++ b/content/treestyletab/res/stopRendering.js @@ -12,7 +12,7 @@ http://www.cozmixng.org/repos/piro/fx3-compatibility-lib/trunk/stopRendering.js */ (function() { - const currentRevision = 6; + const currentRevision = 7; if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {}; @@ -34,6 +34,7 @@ revision : currentRevision, _stopLevel : 0, + _listening : false, get baswWindow() { @@ -51,6 +52,10 @@ } else { this.baswWindow.setPosition(window.top.innerWidth * 3, window.top.innerHeight * 3); + if (!this._listening) { + window.addEventListener('mousedown', this, true); + this._listening = true; + } } this._stopLevel++; }, @@ -61,6 +66,11 @@ if (this._stopLevel > 0) return; + if (this._listening) { + window.removeEventListener('mousedown', this, true); + this._listening = false; + } + this._stopLevel = 0; if (this.useCanvas) { @@ -123,6 +133,13 @@ this._popups.splice(index, 1); } return; + + case 'mousedown': + this._stopLevel = 0; + this.hideCanvas(); + aEvent.stopPropagation(); + aEvent.preventDefault(); + return; } }, @@ -236,12 +253,6 @@ this.shown = false; }, - onClick : function(aEvent) - { - this._stopLevel = 0; - this.hideCanvas(); - }, - get browsers() { @@ -291,7 +302,7 @@ var box = document.createElement('box'); box.setAttribute('id', 'fullScreenCanvas-box'); - box.setAttribute('onclick', 'window["piro.sakura.ne.jp"].stopRendering.onClick(event);'); + box.setAttribute('onmousedown', 'window["piro.sakura.ne.jp"].stopRendering.handleEvent(event);'); this.box = box; box.appendChild(canvas);