Namdak Tonpa 6 лет назад
Родитель
Сommit
99f08d575b

+ 3 - 1
include/nitro.hrl

@@ -15,7 +15,9 @@
         data_fields=[], aria_states=[], body=[], role=[], tabindex=[], show_if=true,
         html_tag=Tag, title=[], postback=[], accesskey=[], contenteditable=[],
         contextmenu=[], dir=[], draggable=[], dropzone=[], hidden=[], lang=[],
-        spellcheck=[], translate=[], onblur=[], onerror=[], onfocus=[], onmessage=[], onresize=[]).
+        spellcheck=[], translate=[], onblur=[], onerror=[], onfocus=[],
+        onmessage=[], onresize=[]).
+
 -define(ACTION_BASE(Module), ancestor=action, trigger=[], target=[], module=Module, actions=[], source=[]).
 -define(CTRL_BASE(Module), ?ELEMENT_BASE(Module,[],Module)).
 

+ 1 - 1
src/elements/element_button.erl

@@ -6,7 +6,7 @@
 render_element(Record) ->
     Id = case Record#button.postback of
         [] -> Record#button.id;
-        [] -> Record#button.id;
+        undefined -> Record#button.id;
         Postback ->
           ID = case Record#button.id of [] -> nitro:temp_id(); I -> I end,
           nitro:wire(#event{type=click, postback=Postback, target=ID,

+ 1 - 1
src/elements/element_input.erl

@@ -5,7 +5,7 @@
 render_element(Record) ->
     Id = case Record#input.postback of
         [] -> Record#input.id;
-        [] -> Record#input.id;
+        undefined -> Record#input.id;
         Postback ->
           ID = case Record#input.id of
             [] -> nitro:temp_id();

+ 1 - 1
src/elements/element_table.erl

@@ -15,7 +15,7 @@ render_element(Record = #table{}) ->
   Bodies = case Record#table.body of
     #tbody{} = B -> B;
     [] -> #tbody{};
-    [] -> #tbody{};
+    unndefined -> #tbody{};
     Rows -> [case B of #tbody{}=B1 -> B1; _-> #tbody{body=B} end  || B <- Rows]
   end,
   Caption = case Record#table.caption of

+ 2 - 2
src/nitro.app.src

@@ -1,6 +1,6 @@
 {application, nitro, [
-    {description,  "NITRO HTML5 DSL"},
-    {vsn,          "3.10"},
+    {description,  "NITRO Web Framework and HTML5 DSL"},
+    {vsn,          "4.4"},
     {applications, [kernel, stdlib]},
     {modules, []},
     {registered,   []},

+ 3 - 3
src/nitro.erl

@@ -5,9 +5,9 @@
 -behaviour(application).
 -export([start/2, stop/1, init/1]).
 
-q(Key) -> Val = get(Key), q(Key,Val).
-q(Key,undefined) -> [];
-q(Key,Val) -> Val.
+q(Key) -> q(Key,get(Key)).
+q(_,undefined) -> [];
+q(_,Val) -> Val.
 
 qc(Key) -> CX = get(context), qc(Key,CX#cx.req).
 qc(Key,Req) -> proplists:get_value(nitro:to_binary(Key),cowboy_req:parse_qs(Req)).

+ 0 - 1
src/render/wf_tags.erl

@@ -12,7 +12,6 @@
 
 emit_tag(TagName, Props) -> [<<"<">>,TagName] ++ write_props(Props) ++ [<<"/>">>].
 emit_tag(TagName, undefined, Props) -> emit_tag(TagName, [], Props);
-emit_tag(TagName, [], Props) -> emit_tag(TagName, [], Props);
 emit_tag(TagName, [[]], Props) -> emit_tag(TagName, [], Props);
 emit_tag(TagName, [undefined], Props) -> emit_tag(TagName, [], Props);
 emit_tag(TagName, <<>>, Props) when ?VOID(TagName) -> emit_tag(TagName, Props);