yui3/commit
dictfy yui3_new
author | Jacco van Ossenbruggen |
---|---|
Fri Aug 8 11:07:11 2014 +0200 | |
committer | Jacco van Ossenbruggen |
Fri Aug 8 11:07:11 2014 +0200 | |
commit | e398741fbe85b255194480c42a3580b1d67301c4 |
tree | bcf77b42c185995a2022155a4a237c6f9398ecb7 |
parent | 5442c910e246da98f01de7e10cc883dc3bac23bf |
Diff style: patch stat
diff --git a/lib/yui3_beta.pl b/lib/yui3_beta.pl index 8032c242cb..25e62d22d2 100644 --- a/lib/yui3_beta.pl +++ b/lib/yui3_beta.pl @@ -120,9 +120,20 @@ yui3_include(List) --> % % Emit javascript object initializer +:- if(current_predicate(is_dict/1)). + +yui3_new(Node, Object, Options) --> + { is_dict(Options), + atom_json_dict(Atom, Options, [as(atom)]) + }, + html(['var ', Node, ' = new ', Object, '(', Atom]), + html(');\n'). + +:-endif. + yui3_new(Node, Object, Options) --> html(['var ', Node, ' = new ', Object, '(']), - js_arg(Options), + js_expression(Options), html(');\n').