bitbake: toaster: importlayer Tidy up the page initialisation

Tidy up the page initialisation and change the error logging so that
it's consistent with other pages.

(Bitbake rev: 3a5b78af4f3cab203824d933a73e82a41ab377e3)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Michael Wood
2014-12-11 14:17:10 +00:00
committed by Richard Purdie
parent 641c50d79b
commit bb83fccb4b

View File

@@ -12,19 +12,20 @@
<script src="{% static 'js/importlayer.js' %}"></script> <script src="{% static 'js/importlayer.js' %}"></script>
<script> <script>
$(document).ready(function (){ $(document).ready(function (){
var ctx = {}; var ctx = {
ctx.xhrDataTypeaheadUrl = "{% url 'xhr_datatypeahead' %}"; xhrDataTypeaheadUrl : "{% url 'xhr_datatypeahead' %}",
ctx.layerDetailsUrl = "{% url 'layerdetails' %}"; layerDetailsUrl : "{% url 'layerdetails' %}",
ctx.xhrImportLayerUrl = "{% url 'xhr_importlayer' %}"; xhrImportLayerUrl : "{% url 'xhr_importlayer' %}",
ctx.xhrEditProjectUrl = "{% url 'xhr_projectedit' project.id %}"; xhrEditProjectUrl : "{% url 'xhr_projectedit' project.id %}",
ctx.projectPageUrl = "{% url 'project' project.id %}"; projectPageUrl : "{% url 'project' project.id %}",
ctx.projectId = {{project.id}}; projectId : {{project.id}}
};
try { try {
importLayerPageInit(ctx); importLayerPageInit(ctx);
} catch(e) { } catch (e) {
document.write(e.stack); document.write("Sorry, An error has occurred loading this page");
console.log(e); console.warn(e);
} }
}); });
</script> </script>