Hi,
It seems that the behavior of [CTRL]-S is broken in the form frame (general for all the objects : project, activity, ...).
I used to save directly with a [ctrl]-S directly when in any input object of the form. Now a window of firefox open to save the html page :huh: .
Although, it seems, that when clicking / focusing into the menu of the frame (where the buttons stand), [ctrl]-S has the right behavior and save the form.
Version Projeqtor : 4.4.2
Firefox : 32.0.3
Hi,
This seems to be a V4.4 regression on FireFox.
I checked : works fine on Chrome & IE, works fine on Firefox with V4.3.
Ticket #1544 recorded
Hi all,
Noticed the same - only on Firefox it seems. One of our developers had a look and found a solution, so hopefully this can help others:
1) in main.php, around line 170:
replace:
var onKeyPressFunc = function(event) {
if(event.ctrlKey && event.keyChar == 's'){
event.preventDefault();
globalSave();
} else if (event.keyCode==dojo.keys.F1 && ! event.keyChar) {
event.preventDefault();
showHelp();
}
};
with :
var onKeyPressFunc = document.addEventListener("keydown", function(e) {
if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) { // CTRL + S
e.preventDefault();
stopDef();
globalSave();
} else if (e.keyCode == 112) { // On F1
e.preventDefault();
stopDef();
showHelp();
}
}, false);
2) In projeqtor.js, add function:
// Prevent default && "unfocus" all inputs
function stopDef(e) {
var inputs, index;
inputs = document.getElementsByTagName('input');
for (index = 0; index < inputs.length; ++index) {
inputs[index].blur();
}
if (e && e.preventDefault)
e.preventDefault();
else if (window.event && window.event.returnValue)
window.eventReturnValue = false;
};
Hi,
Thanks caccia for the workaround.
It confirms my analysis : on FF, the onkeypress is not triggered when focus is in an input field.
So the idea to add listener on the keydown that blurs the field when needed fixes the issue.
But this can lead to loose of focus. Not important if save is correct (frame is refreshed) but if error occurs, focus is lost.
By the way, it was working on V4.3, so I tried to replace dojo version from V10.0 (used un V4.4) to V9.3 (used on V4.4) : and this fixes the issue.
So simple fix is to retrieve /external/dojo /external/dijit and /external/dojox from V4.3.x and overwrite it on V4.4.
NB : I tested Dojo V10.1, issue still exists.
For information I openned an issue in Dojo Trac database : #18303
https://bugs.dojotoolkit.org/ticket/18303
There seems to be another bug. Occurs in 4.4.2 using Chrome. Not sure but might be related to Dojo as well.
Pressing Right Alt + 's' invokes ProjeQtOr save function despite the condition in main.php checking for CTRL key.
I use the Alt+'s' to enter national character so it is confusing. Temporarily removed Ctrl+S shortcut code from main.php.
ProjeQtOr 4.4.2 Chrome 38.0.2125.101 m
Hi,
Strange, but AltGr sets event.ctrlKey ti true.
And it is nit browser dependant...
Solution : in /view/main.php, replace
var onKeyPressFunc = function(event) {
if(event.ctrlKey && event.keyChar == 's'){
with
var onKeyPressFunc = function(event) {
if(event.ctrlKey && ! event.altKey && event.keyChar == 's'){
Fix will be included in V4.5.0