[FIX] webclient embed hack
bzr revid: fme@openerp.com-20130627103508-ewww4270djdygdsf
This commit is contained in:
@@ -62,7 +62,7 @@ class Website(openerp.addons.web.controllers.main.Home):
|
||||
return super(Website, self).index(*args, **kw)
|
||||
|
||||
@http.route('/page/<path:path>', type='http', auth="db")
|
||||
def index(self, **kw):
|
||||
def page(self, **kw):
|
||||
editable = bool(request.session._uid)
|
||||
try:
|
||||
request.session.check_security()
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
(function() {
|
||||
// Init headless webclient
|
||||
// TODO: check embedded mode or how to put it cleanly in a dom ready callback
|
||||
// TODO: Webclient research : use iframe embedding mode
|
||||
// Meanwhile, let's HACK !!!
|
||||
var $web = $('<div style="display: none;"/>').appendTo('body');
|
||||
var s = new openerp.init(['web']);
|
||||
s.web.WebClient.bind_hashchange = s.web.blockUI = s.web.unblockUI = function() {};
|
||||
s.web.WebClient.include({ do_push_state: function() {} });
|
||||
var wc = new s.web.WebClient();
|
||||
// TODO: disable blockUI
|
||||
wc.appendTo($web);
|
||||
var instance = openerp.instances[wc.session.name];
|
||||
|
||||
setTimeout(function () {
|
||||
// HACKY HACK YUCK YUCK !!
|
||||
// TODO: Need modification to webclient. Webclient shall trigger an event when it's ready.
|
||||
// Maybe notification shall trigger event too, so the host can bind on it and use
|
||||
// it's own means in order to trigger it's own notification !?
|
||||
if (instance.web.notification) {
|
||||
instance.web.notification.$el.appendTo('body');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user