Skip to content

Commit 1ddac47

Browse files
committed
More context for current size
Allow the current size value to fill in value for a preset being edited, if there is one. Otherwise it will be used for a new one.
1 parent 5a18da6 commit 1ddac47

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

options.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,10 @@ function showCurrentSize()
176176

177177
function useCurrentSize()
178178
{
179-
document.querySelector("#newWidth").value = window.outerWidth;
180-
document.querySelector("#newHeight").value = window.outerHeight;
179+
let pendingEdit = document.querySelector("#editStatus");
180+
let mode = pendingEdit == null ? MODE_NEW : MODE_EDIT;
181+
document.querySelector("#" + mode + "Width").value = window.outerWidth;
182+
document.querySelector("#" + mode + "Height").value = window.outerHeight;
181183
}
182184

183185
function addPreset(e)

0 commit comments

Comments
 (0)