Paste fixes, workaround to the device. When user clicks the Paste item on the Contextual Menu, the focus goes to the item in the menu, then is not possible to dispatch the cmd_paste on the element where the caret is placed.

This commit is contained in:
mgalli%geckonnection.com 2006-02-15 03:33:24 +00:00
Родитель d48098df86
Коммит bf5d1f7abb
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -802,7 +802,6 @@ function MenuNavPopupShowing () {
}
function BrowserContentAreaPopupShowing () {
var selectedRange=gBrowser.selectedBrowser.contentDocument.getSelection();
@ -824,6 +823,7 @@ function BrowserContentAreaPopupShowing () {
if( targetPopupNode instanceof HTMLInputElement || targetPopupNode instanceof HTMLTextAreaElement ) {
if(DoClipCheckPaste()) {
document.getElementById("item-paste").hidden=false;
gPopupNodeContextMenu = targetPopupNode;
}
} else {
document.getElementById("item-paste").hidden=true;
@ -838,10 +838,8 @@ function BrowserContentAreaPopupShowing () {
} else {
document.getElementById("link_as_new_tab").hidden=true;
}
}
/* Bookmarks */
function BrowserBookmarkThis() {
@ -1093,12 +1091,14 @@ function DoClipCheckPaste()
function DoClipPaste()
{
/* 008 note - value is there in the clipboard, however somehow paste action does not happen.
If you evaluate the canpaste you get false. */
gPopupNodeContextMenu.focus(); // Hack. When the context menu goes open, then we store the Pastable element in gPopupNodeContextMenu
// If the user clicks the element in the Context menu, the focused element changes, then is not pastable
// anymore.
var disp = document.commandDispatcher;
var cont = disp.getControllerForCommand("cmd_paste");
cont.doCommand("cmd_paste");
}
function URLBarEntered()