Commit 5412e7d5 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Fill the panel content in the render method

This will ensure that all other gadgets in the page have been correctly instanciated.
parent b362f232
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
CACHE MANIFEST\n CACHE MANIFEST\n
# generated on Mon, 10 Nov 2015 14:20:00 +0000\n # generated on 12 Nov 2015 10:44:00 +0000\n
# XXX + fonts\n # XXX + fonts\n
# images/ajax-loader.gif\n # images/ajax-loader.gif\n
CACHE:\n CACHE:\n
...@@ -334,7 +334,7 @@ NETWORK:\n ...@@ -334,7 +334,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>946.56378.7589.51541</string> </value> <value> <string>947.3415.22622.22289</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -352,7 +352,7 @@ NETWORK:\n ...@@ -352,7 +352,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1447161601.46</float> <float>1447321457.28</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -139,6 +139,7 @@ ...@@ -139,6 +139,7 @@
.push(function (element) {\n .push(function (element) {\n
g.props.element = element;\n g.props.element = element;\n
g.props.jelement = $(element.querySelector("div"));\n g.props.jelement = $(element.querySelector("div"));\n
g.props.render_deferred = RSVP.defer();\n
});\n });\n
})\n })\n
\n \n
...@@ -151,7 +152,18 @@ ...@@ -151,7 +152,18 @@
});\n });\n
})\n })\n
\n \n
.ready(function (g) {\n /////////////////////////////////////////////////////////////////\n
// declared methods\n
/////////////////////////////////////////////////////////////////\n
.declareMethod(\'toggle\', function () {\n
this.props.jelement.panel("toggle");\n
})\n
.declareMethod(\'close\', function () {\n
this.props.jelement.panel("close");\n
})\n
\n
.declareMethod(\'render\', function () {\n
var g = this;\n
return new RSVP.Queue()\n return new RSVP.Queue()\n
.push(function () {\n .push(function () {\n
return RSVP.all([\n return RSVP.all([\n
...@@ -176,22 +188,9 @@ ...@@ -176,22 +188,9 @@
.push(function (my_translated_or_plain_html) {\n .push(function (my_translated_or_plain_html) {\n
g.props.jelement.html(my_translated_or_plain_html);\n g.props.jelement.html(my_translated_or_plain_html);\n
g.props.jelement.trigger("create");\n g.props.jelement.trigger("create");\n
g.props.render_deferred.resolve();\n
});\n });\n
})\n })\n
\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
/////////////////////////////////////////////////////////////////\n
.declareMethod(\'toggle\', function () {\n
this.props.jelement.panel("toggle");\n
})\n
.declareMethod(\'close\', function () {\n
this.props.jelement.panel("close");\n
})\n
\n
.declareMethod(\'render\', function () {\n
return;\n
})\n
\n \n
/////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////\n
// declared services\n // declared services\n
...@@ -202,13 +201,18 @@ ...@@ -202,13 +201,18 @@
function formSubmit() {\n function formSubmit() {\n
panel_gadget.toggle();\n panel_gadget.toggle();\n
}\n }\n
\n return new RSVP.Queue()\n
return loopEventListener(\n .push(function () {\n
panel_gadget.props.element.querySelector(\'form\'),\n return panel_gadget.props.render_deferred.promise;\n
\'submit\',\n })\n
false,\n .push(function () {\n
formSubmit\n return loopEventListener(\n
);\n panel_gadget.props.element.querySelector(\'form\'),\n
\'submit\',\n
false,\n
formSubmit\n
);\n
});\n
\n \n
});\n });\n
\n \n
...@@ -333,7 +337,7 @@ ...@@ -333,7 +337,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>romain</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -347,7 +351,7 @@ ...@@ -347,7 +351,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>946.30033.2591.56456</string> </value> <value> <string>947.3414.45097.15701</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -365,8 +369,8 @@ ...@@ -365,8 +369,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1445354788.68</float> <float>1447320446.53</float>
<string>GMT</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
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