зеркало из https://github.com/mozilla/pjs.git
temp workaround for 23669: don't go to url on middle mouse clicks
if we're over a text field or area, because the event was probably already handled by the editor and we shouldn't have gotten it at all. Code from joki, r=me.
This commit is contained in:
Родитель
549e5879ac
Коммит
252da28272
|
@ -1263,15 +1263,20 @@ function BrowserEditBookmarks()
|
|||
return url;
|
||||
}
|
||||
|
||||
function browserLoadClipboardURL()
|
||||
function browserLoadClipboardURL(target)
|
||||
{
|
||||
var url = readFromClipboard();
|
||||
dump ("URL on clipboard: '" + url + "'; length = " + url.length + "\n");
|
||||
if (url.length > 0)
|
||||
if (!((target.tagName.toUpperCase() == "INPUT"
|
||||
&& (target.type == "" || target.type.toUpperCase() == "TEXT"))
|
||||
|| target.tagName.toUpperCase() == "TEXTAREA"))
|
||||
{
|
||||
var urlBar = document.getElementById("urlbar");
|
||||
urlBar.value = url;
|
||||
BrowserLoadURL();
|
||||
var url = readFromClipboard();
|
||||
dump ("URL on clipboard: '" + url + "'; length = " + url.length + "\n");
|
||||
if (url.length > 0)
|
||||
{
|
||||
var urlBar = document.getElementById("urlbar");
|
||||
urlBar.value = url;
|
||||
BrowserLoadURL();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -412,7 +412,7 @@ Contributor(s): ______________________________________. -->
|
|||
<splitter id="sidebar-splitter" chromeclass="extrachrome" />
|
||||
|
||||
<box id="appcontent" align="vertical" flex="100%"
|
||||
onclick="if (event.button==2) browserLoadClipboardURL();"
|
||||
onclick="if (event.button==2) browserLoadClipboardURL(event.target);"
|
||||
ondragover="return DragOverContentArea(event);"
|
||||
ondragdrop="return DropOnContentArea(event);">
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче