Edit style: remember detached window position and size

This commit is contained in:
tophf 2015-03-11 03:00:44 +03:00
parent 8844b71aab
commit f654cc734f
2 changed files with 10 additions and 1 deletions

View File

@ -69,6 +69,12 @@ function makeDirty() {
}
window.onbeforeunload = function() {
prefs.setPref('windowPosition', {
left: screenLeft,
top: screenTop,
width: outerWidth,
height: outerHeight
});
return dirty || isCodeDirty() ? t('styleChangesNotSaved') : null;
}

View File

@ -144,7 +144,10 @@ function getId(event) {
function openLinkInTabOrWindow(event) {
event.preventDefault();
if (prefs.getPref('openEditInWindow', false)) {
chrome.windows.create({url: event.target.href});
var options = {url: event.target.href}
var wp = prefs.getPref('windowPosition', {});
for (var k in wp) options[k] = wp[k];
chrome.windows.create(options);
} else {
openLink(event);
}