Commit a3a26621 authored by Sebastien Robin's avatar Sebastien Robin

erp5_code_mirror: make sure to not loose focus when saving

We might need to consider this change globally for all fields later.
parent 3526922a
......@@ -79,14 +79,17 @@
} else if (options.portal_type === 'Web Style') {
mode = 'css';
} else if (options.portal_type === 'Python Script') {
console.log("switch to mode python");
mode = 'python';
}
state_dict.mode = mode;
state_dict.value = options.value || "";
/* if (!this.editor.hasFocus()) {
//The if below is not good, we should look for a general improvements
//to make sure all fields do not loose focus. But it is unsure now if
//this change could be applied globally (like we might have cases where
//the backend slightly change data).
//state_dict.value = options.value || "";
if (!this.editor.hasFocus()) {
state_dict.value = options.value || "";
} */
}
return this.changeState(state_dict);
})
......
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