From 2863b43c7ec341503175a389cec84f57edbc1e8b Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 17 Jan 2013 17:12:33 +0100 Subject: [PATCH] uses jquery for jsonp bzr revid: nicolas.vanhoren@openerp.com-20130117161233-zyd6z50nbljzh603 --- .../static/ext/static/js/livesupport.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/addons/live_support/static/ext/static/js/livesupport.js b/addons/live_support/static/ext/static/js/livesupport.js index 4ef430d5341..0e1ca6b1bde 100644 --- a/addons/live_support/static/ext/static/js/livesupport.js +++ b/addons/live_support/static/ext/static/js/livesupport.js @@ -7,14 +7,12 @@ define(["nova", "jquery", "underscore", "oeclient", "require"], function(nova, $ var connection; livesupport.main = function(server_url, db, login, password) { - var def = $.Deferred(); - var tmp = window.oe_livesupport_templates_callback; - window.oe_livesupport_templates_callback = _.bind(def.resolve, def); - setTimeout(_.bind(def.reject, def), 5000); - var src = $('').appendTo($("head")); - def.then(function(content) { - window.oe_livesupport_templates_callback = tmp; - src.remove(); + $.ajax({ + url: require.toUrl("./livesupport_templates.js"), + jsonpCallback: "oe_livesupport_templates_callback", + dataType: "jsonp", + cache: true, + }).then(function(content) { return templateEngine.loadFileContent(content); }).then(function() { connection = new oeclient.Connection(new oeclient.JsonpRPCConnector(server_url), db, login, password);