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 @@
<value> <string encoding="cdata"><![CDATA[
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
# images/ajax-loader.gif\n
CACHE:\n
......@@ -334,7 +334,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.56378.7589.51541</string> </value>
<value> <string>947.3415.22622.22289</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -352,7 +352,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1447161601.46</float>
<float>1447321457.28</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -139,6 +139,7 @@
.push(function (element) {\n
g.props.element = element;\n
g.props.jelement = $(element.querySelector("div"));\n
g.props.render_deferred = RSVP.defer();\n
});\n
})\n
\n
......@@ -151,7 +152,18 @@
});\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
.push(function () {\n
return RSVP.all([\n
......@@ -176,22 +188,9 @@
.push(function (my_translated_or_plain_html) {\n
g.props.jelement.html(my_translated_or_plain_html);\n
g.props.jelement.trigger("create");\n
g.props.render_deferred.resolve();\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
// declared services\n
......@@ -202,13 +201,18 @@
function formSubmit() {\n
panel_gadget.toggle();\n
}\n
\n
return loopEventListener(\n
panel_gadget.props.element.querySelector(\'form\'),\n
\'submit\',\n
false,\n
formSubmit\n
);\n
return new RSVP.Queue()\n
.push(function () {\n
return panel_gadget.props.render_deferred.promise;\n
})\n
.push(function () {\n
return loopEventListener(\n
panel_gadget.props.element.querySelector(\'form\'),\n
\'submit\',\n
false,\n
formSubmit\n
);\n
});\n
\n
});\n
\n
......@@ -333,7 +337,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -347,7 +351,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.30033.2591.56456</string> </value>
<value> <string>947.3414.45097.15701</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -365,8 +369,8 @@
</tuple>
<state>
<tuple>
<float>1445354788.68</float>
<string>GMT</string>
<float>1447320446.53</float>
<string>UTC</string>
</tuple>
</state>
</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