Bug 11464: Prevent wrong "nothing to save" message on saving syspref
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 23 Apr 2015 14:57:31 +0000 (16:57 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 7 May 2015 14:01:16 +0000 (11:01 -0300)
commitee478c3605962efcd160bba6dacad3f69f8e9c43
tree507d1e1b081d4f227fbeb4be35db158214e106a0
parente5858e16ec455ba14b964b51627287bb0219131c
Bug 11464: Prevent wrong "nothing to save" message on saving syspref

Sometime you get the "Nothing to save" message when clicking on the "save
all preferences" button, even if something has changed.

On irritating behavior is the middle click: if you use the middle click
to paste some text in the input, the "keyup" event won't be trigger.
This patch replaces the "keyup" event with the "change", which works
as we want here.

The issues:
1/ Search for "wanted" (admin/preferences.pl?op=search&searchfield=wanted)
Empty the input, click save
Type something and remove it
You are able to save, but nothing has changed
2/ Put something in your selection buffer and use the middle click to
paste it in the input.
No change detected.

Test plan:
Confirm the issues are fixed and you don't find any regression
Note that now the "(modified)" string is displayed when the input loses
the focus.

Followed test plan. Works as expected.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js