View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - [SOLVED] [CTRL]-S to save in form window broken ? - ProjeQtOr
 
 

[SOLVED] [CTRL]-S to save in form window broken ?

More
07 Oct 2014 17:21 #1 by DPo
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

Please Log in or Create an account to join the conversation.

More
07 Oct 2014 17:48 #2 by babynus
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

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
07 Oct 2014 17:56 #3 by caccia
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;
};

Please Log in or Create an account to join the conversation.

More
07 Oct 2014 18:34 #4 by babynus
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.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
07 Oct 2014 20:23 #5 by babynus
For information I openned an issue in Dojo Trac database : #18303
bugs.dojotoolkit.org/ticket/18303

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
14 Oct 2014 17:51 #6 by JarekD
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

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.055 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.