diff --git a/addons/survey/static/src/js/survey.js b/addons/survey/static/src/js/survey.js index 02ddcd9547d..d05fc5412af 100644 --- a/addons/survey/static/src/js/survey.js +++ b/addons/survey/static/src/js/survey.js @@ -1,3 +1,7 @@ +odoo.define('survey.survey', ['website.website'], function (require) { +'use strict'; + +var website = require('website.website'); /* * OpenERP, Open Source Management Solution * Copyright (C) 2004-TODAY OpenERP S.A. @@ -21,13 +25,10 @@ * the website engine. */ -(function () { -'use strict'; -openerp.website.if_dom_contains('.js_surveyform', function (the_form) { +website.if_dom_contains('.js_surveyform', function (the_form) { console.debug("[survey] Custom JS for survey is loading..."); var prefill_controller = the_form.attr("data-prefill"); - var validate_controller = the_form.attr("data-validate"); var submit_controller = the_form.attr("data-submit"); var scores_controller = the_form.attr("data-scores"); var print_mode = false; @@ -180,4 +181,5 @@ openerp.website.if_dom_contains('.js_surveyform', function (the_form) { console.debug("[survey] Custom JS for survey loaded!"); }); -})(); + +}); diff --git a/addons/survey/static/src/js/survey_result.js b/addons/survey/static/src/js/survey_result.js index 780345c736b..e6f8afedeae 100644 --- a/addons/survey/static/src/js/survey_result.js +++ b/addons/survey/static/src/js/survey_result.js @@ -1,3 +1,8 @@ +odoo.define('survey.result', ['website.website'], function (require) { +'use strict'; + +var website = require('website.website'); + /* * OpenERP, Open Source Management Solution * Copyright (C) 2004-TODAY OpenERP S.A. @@ -16,9 +21,7 @@ * along with this program. If not, see . */ -(function () { -'use strict'; -openerp.website.if_dom_contains('.js_surveyresult', function () { +website.if_dom_contains('.js_surveyresult', function () { console.debug("[survey] Survey Result JS is loading..."); //Script For Pagination @@ -52,7 +55,7 @@ openerp.website.if_dom_contains('.js_surveyresult', function () { .staggerLabels(true); // Replacing Library's Default Tooltip with our Custom One - chart.tooltip(function(key, x, y, e, graph) { + chart.tooltip(function(key, x, y, e) { return '
' + x + '
' + '

' + 'Responses : ' + key + '

' + '

' + "Total Vote : " + y + '

'; @@ -176,4 +179,5 @@ openerp.website.if_dom_contains('.js_surveyresult', function () { console.debug("[survey] Survey Result JS loaded!"); }); -})(); + +});