Browse Source

n2o_sample compatible fix

m-2k 8 years ago
parent
commit
73d804f24a
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/render/wf_event.erl

+ 2 - 3
src/render/wf_event.erl

@@ -22,7 +22,6 @@ new(Postback, Element, Delegate, Name, Data, Source, Validation) ->
            ([E]) -> [$'|E]++[$'];
          ([H|T]) -> [[$'|H]++[$']] ++ [ [$,,$'|E]++[$'] || E <- T ] end,
     Event = #ev{name=Name, module=Module, msg=Postback, trigger=Element},
-    list_to_binary(["{ if (validateSources([",
-        Join([ case is_atom(S) of true -> ?B(S); false -> S end || S <- Source, S =/= []]),
+    list_to_binary(["{ if (validateSources([",Join([ nitro:to_list(S) || S <- Source, S =/= []]),
         "])) { ",?B(Validation)," ws.send(enc(tuple(atom('",?B(application:get_env(n2o,event,pickle)),"'),bin('",
-        Element,"'),bin('",nitro:pickle(Event),"'),",Data,"))); } else console.log('Validation Error'); }"]).
+        Element,"'),bin('",nitro:pickle(Event),"'),",Data,"))); } else console.log('Validation Error'); }"]).