Browse Source

Merge branch 'master' of github.com:synrc/nitro

Namdak Tonpa 5 years ago
parent
commit
10496219a7
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/actions/action_event.erl

+ 3 - 2
src/actions/action_event.erl

@@ -15,8 +15,9 @@ render_action(#event{postback=Postback,actions=_A,source=Source,target=Control,t
      "',function (event){ event.preventDefault(); ",PostbackBin,"});};"].
 
 data(E,SourceList) ->
-    Type=fun(A) when is_atom(A) -> [ "atom('",atom_to_list(A),"')" ];
-                            (A) -> [ "string('",A,"')" ] end,
+    Type=fun(A) when is_atom(A)   -> [ "atom('",atom_to_list(A),"')" ];
+            (A) when is_binary(A) -> [ "bin('",binary_to_list(A),"')" ];
+                              (A) -> [ "string('",A,"')" ] end,
     list_to_binary(["[tuple(tuple(string('",E,"'),bin('detail')),[])",
         [ case S of {Id,Code} -> [ ",tuple(",Type(Id),",",Code,")" ];
                             _ -> [ ",tuple(",Type(S),",querySource('",?B(S),"'))" ]