[FIX] web: correct jsonp behavior when len(payload) >= 2000
bzr revid: chs@openerp.com-20120531132020-ccagkni2dqu6i75u
This commit is contained in:
@@ -568,19 +568,19 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
|
||||
} else {
|
||||
// Indirect jsonp request
|
||||
var ifid = _.uniqueId('oe_rpc_iframe');
|
||||
var display = options.openerp.debug ? 'block' : 'none';
|
||||
var display = this.debug ? 'block' : 'none';
|
||||
var $iframe = $(_.str.sprintf("<iframe src='javascript:false;' name='%s' id='%s' style='display:%s'></iframe>", ifid, ifid, display));
|
||||
var $form = $('<form>')
|
||||
.attr('method', 'POST')
|
||||
.attr('target', ifid)
|
||||
.attr('enctype', "multipart/form-data")
|
||||
.attr('action', ajax.url + '?' + $.param(data))
|
||||
.attr('action', ajax.url + '?jsonp=1&' + $.param(data))
|
||||
.append($('<input type="hidden" name="r" />').attr('value', payload_str))
|
||||
.hide()
|
||||
.appendTo($('body'));
|
||||
var cleanUp = function() {
|
||||
if ($iframe) {
|
||||
$iframe.unbind("load").attr("src", "javascript:false;").remove();
|
||||
$iframe.unbind("load").remove();
|
||||
}
|
||||
$form.remove();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user