diff options
| author | Denis Ledoux <dle@openerp.com> | 2013-06-21 14:44:49 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@openerp.com> | 2013-06-21 14:44:49 +0200 |
| commit | 1f6bf43079cf3314bfa9ca5a216e57db6c4b50b4 (patch) | |
| tree | 68b903055cd6cefbd6ad085bee3a8a3a21ab477d /addons/web/static/src/js | |
| parent | 5eb68b48446111d0e9629fba9619cb2ea10c50a3 (diff) | |
[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
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/coresetup.js | 10 | ||||
| -rw-r--r-- | addons/web/static/src/js/views.js | 14 |
2 files changed, 24 insertions, 0 deletions
diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 6fc837333b6..ca702917d1d 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -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 () { diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index f9050369a83..21ff627c544 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -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({ |
