Skip to content
Snippets Groups Projects
Commit 4dd5dbb2 authored by Simon Lejeune's avatar Simon Lejeune
Browse files

[FIX] survey: only load js scripts when needed

This is done with the help of website.if_dom_contains and 1) js_surveyform
class for survey.js 2) a new fake class js_surveyresult for survey_result.js
This fix also allow to avoid spurious logs on runbot during phantomjs tests.
parent 0f99b725
No related branches found
No related tags found
No related merge requests found
......@@ -21,12 +21,11 @@
* the website engine.
*/
$(document).ready(function () {
'use strict';
(function () {
'use strict';
openerp.website.if_dom_contains('.js_surveyform', function (the_form) {
console.debug("[survey] Custom JS for survey is loading...");
var the_form = $('.js_surveyform');
var prefill_controller = the_form.attr("data-prefill");
var validate_controller = the_form.attr("data-validate");
var submit_controller = the_form.attr("data-submit");
......@@ -153,3 +152,4 @@ $(document).ready(function () {
console.debug("[survey] Custom JS for survey loaded!");
});
})();
......@@ -16,8 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$(document).ready(function () {
'use strict';
(function () {
'use strict';
openerp.website.if_dom_contains('.js_surveyresult', function () {
console.debug("[survey] Survey Result JS is loading...");
//Script For Pagination
......@@ -174,4 +175,5 @@ $(document).ready(function () {
});
console.debug("[survey] Survey Result JS loaded!");
});
\ No newline at end of file
});
})();
......@@ -13,7 +13,7 @@
<template id="result" name="Survey Result">
<t t-call="website.layout">
<div class="oe_structure" />
<div class="container">
<div class="container js_surveyresult">
<div class="jumbotron mt32">
<h1><span t-field="survey.title" /> <span style="font-size:1.5em;" class="fa fa-bar-chart-o pull-right "/></h1>
<div t-field="survey.description" class="oe_no_empty" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment