Commit 57354f01 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: fix textarea notify change after saving by pressing key error

parent f7d81aa8
...@@ -96,8 +96,17 @@ ...@@ -96,8 +96,17 @@
.declareAcquiredMethod("notifySubmit", "notifySubmit") .declareAcquiredMethod("notifySubmit", "notifySubmit")
.onEvent('keydown', function (evt) { .onEvent('keydown', function (evt) {
var textarea = this.element.querySelector('textarea');
if (evt.keyCode === 83 && (navigator.platform.match("Mac") ? evt.metaKey : evt.ctrlKey)) { if (evt.keyCode === 83 && (navigator.platform.match("Mac") ? evt.metaKey : evt.ctrlKey)) {
//Textarea's change event is generally launched by browser when press a predefined key
//Call preventDefault prevent change event
evt.preventDefault(); evt.preventDefault();
//When lose focus, change event is launched
//Without this, after saving, then click other fields or go to other view
//Change event will be trigged and there will have a unsaved warning for textarea
textarea.blur();
//Refocus for consistency
textarea.focus();
return this.notifySubmit(); return this.notifySubmit();
} }
}, false, false); }, false, false);
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.62583.15371.20411</string> </value> <value> <string>966.9555.11713.4232</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,8 +254,8 @@ ...@@ -254,8 +254,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1512575560.52</float> <float>1520933309.18</float>
<string>UTC</string> <string>GMT+1</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment