Also tried (1) without the trailing semi-colon (because of inline-js-code-is-handled-incorrectly). Code now appears in the .js file, but

1
[<Direct "$('.ui.sidebar').sidebar('toggle')">]

is translated to

1
2
3
4
function()
   {
    <<namespace>>.toggle();
   }

where <<namespace>> is the name of the current module.

By on 5/2/2017 5:54 AM ()

Indeed, the missing code was due to #684, this is fixed now in latest release.

The purpose of the Direct attribute is to create a global function that has custom JS code. So the translation seems correct, if you write

1
2
[<Direct "$('.ui.sidebar').sidebar('toggle');">]
let ToggleSidebar() = ()

you should also get:

1
2
3
4
 Client.ToggleSidebar=function()
 {
  Global.$(".ui.sidebar").sidebar("toggle");
 };

in the code, and where you use the function, it calls into this.

Please report if any issues remain after updating to latest version, thanks.

By on 5/2/2017 6:33 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us
Built with WebSharper