IDEMPIERE-5321 Color editor not working on Chrome (#1370)

This commit is contained in:
hengsin 2022-06-21 13:06:28 +08:00 committed by GitHub
parent a335d97eb1
commit 1873e175be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 2 deletions

View File

@ -103,9 +103,22 @@ public class WColorEditor extends WEditor implements ContextMenuListener
+ "border:none !important;margin:0 !important;padding:0 !important;visibility:hidden;"); + "border:none !important;margin:0 !important;padding:0 !important;visibility:hidden;");
getComponent().appendChild(colorbox); getComponent().appendChild(colorbox);
colorbox.addEventListener(Events.ON_CHANGE, e -> { colorbox.addEventListener("onInput", e -> {
processNewValue(colorbox.getValue()); processNewValue((String)e.getData());
}); });
colorbox.setWidgetOverride("__doOnInput", "function(evt) {"
+ " let v=this.$n().value;"
+ " this.fire('onInput',v,{toServer:true});"
+ "}");
colorbox.setWidgetOverride("bind_", "function() {"
+ " this.$supers('bind_',arguments);"
+ " this.domListen_(this.$n(),'oninput','__doOnInput');"
+ "}");
colorbox.setWidgetOverride("unbind_", "function() {"
+ " this.domUnlisten_(this.$n(),'oninput','__doOnInput');"
+ " this.$supers('unbind_',arguments);"
+ "}");
} }
private void init() private void init()