From 1c1e9a718780ac2647216fb2a7966867a0be1183 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Thu, 14 Jul 2011 07:55:00 +0000 Subject: [PATCH] Accept hyphenized keys when creating properties, so as we can copy and paste css properties --- .../main/java/com/google/gwt/query/client/Properties.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java index 86a7a2c8..4012fd0c 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/Properties.java @@ -28,7 +28,7 @@ public class Properties extends JavaScriptObject { } public static Properties create(String properties) { - String p = wrapPropertiesString(properties); + String p = camelizePropertiesKeys(wrapPropertiesString(properties)); try { return (Properties) createImpl(p); } catch (Exception e) { @@ -56,6 +56,12 @@ public class Properties extends JavaScriptObject { + "})"; return ret; } + + public static native String camelizePropertiesKeys(String s)/*-{ + return s.replace(/(\w+)\-(\w)(\w*:)/g, function(all, g1, letter, g2) { + return g1 + letter.toUpperCase() + g2; + }); + }-*/; protected Properties() { } -- 2.39.5