Edit style: remember detached window position and size
This commit is contained in:
parent
8844b71aab
commit
f654cc734f
6
edit.js
6
edit.js
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
5
popup.js
5
popup.js
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user