Use code similar to sidebar customize dialog and bookmarks window to make history window non-modal (bug #20830). Also make history window resizable (bug #20828).

This commit is contained in:
slamm%netscape.com 2000-01-06 22:43:47 +00:00
Родитель 7cd27e242d
Коммит fc1796f433
1 изменённых файлов: 31 добавлений и 1 удалений

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

@ -29,9 +29,39 @@ function toIRC()
} }
// Set up a lame hack to avoid opening two bookmarks.
// Could otherwise happen with two Ctrl-B's in a row.
var gDisableHistory = false;
function enableHistory() {
gDisableHistory = false;
}
function toHistory() function toHistory()
{ {
window.open( "chrome://history/content/", "_blank", "chrome,dependent=yes,all" ); // Use a single sidebar history dialog
var cwindowManager = Components.classes['component://netscape/rdf/datasource?name=window-mediator'].getService();
var iwindowManager = Components.interfaces.nsIWindowMediator;
var windowManager = cwindowManager.QueryInterface(iwindowManager);
var historyWindow = windowManager.GetMostRecentWindow('history:manager');
if (historyWindow) {
//debug("Reuse existing history window");
historyWindow.focus();
} else {
//debug("Open a new history dialog");
if (true == gDisableHistory) {
//debug("Recently opened one. Wait a little bit.");
return;
}
gDisableHistory = true;
window.open( "chrome://history/content/", "_blank", "chrome,menubar,resizable,scrollbars" );
setTimeout(enableHistory, 2000);
}
} }
function toJavaConsole() function toJavaConsole()