Added ctrl+s keyboard shortcut
This commit is contained in:
parent
0eb2fd3ab0
commit
a415d22589
3 changed files with 23 additions and 6 deletions
|
@ -2,6 +2,7 @@ Version 0.2.6 (2018-)
|
|||
- Displaying current filename in title (Issue #76) @danielperna84
|
||||
- Added menu item to open configurator in new tab (Issue #76) @danielperna84
|
||||
- Automatically load last viewed (and not closed) file via localStorage @danielperna84
|
||||
- CTRL+s / CMD+s can now be used to save a file @danielperna84
|
||||
|
||||
Version 0.2.5 (2018-01-27)
|
||||
- Added warning-logs for access failure @danielperna84
|
||||
|
|
|
@ -2082,7 +2082,6 @@ INDEX = Template(r"""<!DOCTYPE html>
|
|||
}
|
||||
|
||||
window.onfocus = function() {
|
||||
console.log("got focus");
|
||||
got_focus_or_visibility();
|
||||
}
|
||||
//window.onblur = function() {
|
||||
|
@ -2104,7 +2103,7 @@ INDEX = Template(r"""<!DOCTYPE html>
|
|||
hidden = "webkitHidden";
|
||||
visibilityChange = "webkitvisibilitychange";
|
||||
}
|
||||
|
||||
|
||||
function handleVisibilityChange() {
|
||||
if (document[hidden]) {
|
||||
// We're doing nothing when the tab gets out of vision
|
||||
|
@ -2122,7 +2121,16 @@ INDEX = Template(r"""<!DOCTYPE html>
|
|||
// Handle page visibility change
|
||||
document.addEventListener(visibilityChange, handleVisibilityChange, false);
|
||||
}
|
||||
|
||||
|
||||
$(document).keydown(function(e) {
|
||||
if ((e.key == 's' || e.key == 'S' ) && (e.ctrlKey || e.metaKey)) {
|
||||
e.preventDefault();
|
||||
save();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$('select').material_select();
|
||||
$('.modal').modal();
|
||||
|
|
14
dev.html
14
dev.html
|
@ -1998,7 +1998,6 @@
|
|||
}
|
||||
|
||||
window.onfocus = function() {
|
||||
console.log("got focus");
|
||||
got_focus_or_visibility();
|
||||
}
|
||||
//window.onblur = function() {
|
||||
|
@ -2020,7 +2019,7 @@
|
|||
hidden = "webkitHidden";
|
||||
visibilityChange = "webkitvisibilitychange";
|
||||
}
|
||||
|
||||
|
||||
function handleVisibilityChange() {
|
||||
if (document[hidden]) {
|
||||
// We're doing nothing when the tab gets out of vision
|
||||
|
@ -2038,7 +2037,16 @@
|
|||
// Handle page visibility change
|
||||
document.addEventListener(visibilityChange, handleVisibilityChange, false);
|
||||
}
|
||||
|
||||
|
||||
$(document).keydown(function(e) {
|
||||
if ((e.key == 's' || e.key == 'S' ) && (e.ctrlKey || e.metaKey)) {
|
||||
e.preventDefault();
|
||||
save();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$('select').material_select();
|
||||
$('.modal').modal();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue