Knockout tests pass OK in FX Web View now fx
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 18 Apr 2013 20:09:45 +0200
branchfx
changeset 1015d7cff2cba6e5
parent 1014 7a7686e6f875
child 1016 6dc2c6c752df
Knockout tests pass OK in FX Web View now
javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/Knockout.java
     1.1 --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/Knockout.java	Thu Apr 18 17:28:34 2013 +0200
     1.2 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/Knockout.java	Thu Apr 18 20:09:45 2013 +0200
     1.3 @@ -137,6 +137,14 @@
     1.4  
     1.5      @JavaScriptBody(args = { "id", "ev" }, body = "ko.utils.triggerEvent(window.document.getElementById(id), ev.substring(2));")
     1.6      public static void triggerEvent(String id, String ev) {
     1.7 +        JSObject js = (JSObject) web().executeScript("(function () {"
     1.8 +            + "  var x = {}; "
     1.9 +            + "  x.trigger= function(id, ev) { "
    1.10 +            + "    ko.utils.triggerEvent(window.document.getElementById(id), ev.substring(2));;\n"
    1.11 +            + "  };"
    1.12 +            + "  return x;"
    1.13 +            + "})()");
    1.14 +        js.call("trigger", id, ev);
    1.15      }
    1.16      
    1.17      @JavaScriptBody(args = { "bindings", "model", "prop", "getter", "setter", "primitive", "array" }, body =