[FIX]web: views.js & coresetup.js, ir_actions_report_xml and get_file special case for iOS devices, which do not allow iframe use the way we do it

bzr revid: dle@openerp.com-20130621124449-e3qyz7m7yfvhta1d
This commit is contained in:
Denis Ledoux 2013-06-21 14:44:49 +02:00
parent 5eb68b4844
commit 1f6bf43079
2 changed files with 24 additions and 0 deletions

View File

@ -283,6 +283,16 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
CHECK_INTERVAL = 1000, id = _.uniqueId('get_file_frame'),
remove_form = false;
// iOS devices doesn't allow iframe use the way we do it,
// opening a new window seems the best way to workaround
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/) || true) {
var params = _.extend({}, options.data || {}, {token: token});
var url = this.url(options.url, params);
instance.web.unblockUI();
return window.open(url);
}
var $form, $form_data = $('<div>');
var complete = function () {

View File

@ -470,6 +470,20 @@ instance.web.ActionManager = instance.web.Widget.extend({
}).then(function(res) {
action = _.clone(action);
action.context = res.context;
// iOS devices doesn't allow iframe use the way we do it,
// opening a new window seems the best way to workaround
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
var params = {
action: JSON.stringify(action),
token: new Date().getTime()
}
var url = self.session.url('/web/report', params)
instance.web.unblockUI();
$('<a href="'+url+'" target="_blank"></a>')[0].click();
return;
}
var c = instance.webclient.crashmanager;
return $.Deferred(function (d) {
self.session.get_file({