From fbc3210184475a7f789fe20d6817a3820ce7d675 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 31 Jan 2011 14:32:40 +0100 Subject: [PATCH] don't hide text viewer when clicking inside the text box --- plugins/textviewer/textviewer.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/textviewer/textviewer.js b/plugins/textviewer/textviewer.js index 6b031ccd84..f71b63d7c1 100644 --- a/plugins/textviewer/textviewer.js +++ b/plugins/textviewer/textviewer.js @@ -50,6 +50,14 @@ OC_TextViewer.showText=function(dir,file){ div.setAttribute('class','center'); div.addEvent('onclick',OC_TextViewer.hideText) OC_TextViewer.textFrame=document.createElement('div'); + OC_TextViewer.textFrame.addEvent('onclick',function(e){ + if(window.event = true){ + window.event.cancelBubble = true; + } + if(e.stopPropagation){ + e.stopPropagation(); + } + }); OC_TextViewer.textFrame.pre=document.createElement('pre'); div.appendChild(OC_TextViewer.textFrame); OC_TextViewer.textFrame.appendChild(OC_TextViewer.textFrame.pre);