Commit f37dbece authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: improve gadgetfield

1: Resize gadget if it's declared in  iframe
2: Add getContent test
parent 73eb31dc
...@@ -120,7 +120,16 @@ ...@@ -120,7 +120,16 @@
});\n });\n
})\n })\n
.push(function (field_gadget) {\n .push(function (field_gadget) {\n
var iframe;\n
gadget.props.field_gadget = field_gadget;\n gadget.props.field_gadget = field_gadget;\n
if (field_json.css_class) {\n
gadget_element.setAttribute("class", field_json.css_class);\n
}\n
if (field_json.sandbox === "iframe") {\n
iframe = gadget_element.querySelector("iframe");\n
iframe.style.width = "100%";\n
iframe.style.height = "100%";\n
}\n
if (field_gadget.render !== undefined) {\n if (field_gadget.render !== undefined) {\n
return field_gadget.render(suboptions);\n return field_gadget.render(suboptions);\n
}\n }\n
...@@ -163,7 +172,9 @@ ...@@ -163,7 +172,9 @@
}\n }\n
})\n })\n
.declareMethod("getContent", function () {\n .declareMethod("getContent", function () {\n
return this.props.field_gadget.getContent();\n if (this.props.field_gadget.getContent) {\n
return this.props.field_gadget.getContent();\n
}\n
});\n });\n
}(window, document, rJS, RSVP));\n }(window, document, rJS, RSVP));\n
</string> </value> </string> </value>
...@@ -301,7 +312,7 @@ ...@@ -301,7 +312,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>940.17406.2535.58641</string> </value> <value> <string>940.57981.32712.11997</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -319,7 +330,7 @@ ...@@ -319,7 +330,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1421153187.18</float> <float>1423588896.63</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment