Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove OK button from about dialog, close on escape
  • Loading branch information
rakillen committed Nov 9, 2021
commit 3f4a345865ceaf31172ac04adc6d4b378a5b815c
3 changes: 0 additions & 3 deletions electron/app/js/prompt/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<div id="appName" class="textLine main">...</div>
<div id="version" class="textLine">...</div>
<div id="copyright" class="textLine">...</div>
<div id="buttons">
<button type="submit" id="ok">...</button>
</div>
</form>
</div>
<script src="about.js"></script>
Expand Down
8 changes: 1 addition & 7 deletions electron/app/js/prompt/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,14 @@ function promptRegister() {
return promptError(error);
}

const okButton = document.querySelector('#ok');

okButton.addEventListener('keyup', event => {
document.addEventListener('keyup', event => {
if (event.key === 'Escape') {
promptCancel();
}
});

document.querySelector('#form').addEventListener('submit', promptSubmit);

okButton.focus();

window.api.i18n.ready.then(() => {
const versionText = window.api.i18n.t('dialog-about-version', {
version: promptOptions.applicationVersion,
Expand All @@ -55,8 +51,6 @@ function promptRegister() {
document.querySelector('#version').textContent = versionText;
document.querySelector('#copyright').textContent = promptOptions.copyright;

okButton.textContent = window.api.i18n.t('dialog-button-ok');

const height = document.querySelector('body').offsetHeight;
window.api.ipc.sendSync('prompt-size:' + promptId, height);
});
Expand Down
2 changes: 1 addition & 1 deletion electron/app/js/promptUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async function showAboutDialog(wktApp, parentWindow) {
const preloadFile = path.join(__dirname, 'prompt', 'preload.js');

const WIDTH = 400;
const HEIGHT = 234; // renderer will send IPC to adjust this
const HEIGHT = 186; // renderer will send IPC to adjust this
const MIN_HEIGHT = 120; // needs to be smaller than content height

return new Promise((resolve, reject) => {
Expand Down