Disable editor on smartphones

<=767px according to bootstrap responsive classes

bzr revid: ddm@openerp.com-20130822124013-br8ccw8hb26dr060
This commit is contained in:
ddm 2013-08-22 14:40:13 +02:00
parent b9f2e796ca
commit f820c074a1
2 changed files with 10 additions and 12 deletions

View File

@ -198,10 +198,8 @@
}, },
mobilePreview: function () { mobilePreview: function () {
$('body').addClass('oe_stop_scrolling'); $('body').addClass('oe_stop_scrolling');
// Firefox hack: document.getElementById("mobile-viewport").src = window.location.href + "?"; document.getElementById("mobile-viewport").src = window.location.href + "?mobile-preview=true";
// TODO: disable scrollbar in iframe instead of forbidding scrolling
var iframeBody = $("#mobile-viewport").contents().find("body");
//iframeBody.css("overflow-y", "hidden");
}, },
}); });
@ -679,7 +677,7 @@
dom_ready.then(function () { dom_ready.then(function () {
website.is_editable = $('html').attr('data-editable') === '1'; website.is_editable = $('html').attr('data-editable') === '1';
if (website.is_editable) { if (website.is_editable && $('body')[0].clientWidth >= 767) {
website.ready().then(website.init_editor); website.ready().then(website.init_editor);
} }

View File

@ -45,7 +45,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="oe_mobile_preview"> <div class="oe_mobile_preview">
<iframe id="mobile-viewport" class="oe_mobile_viewport" src="?mobile-preview=true"></iframe> <iframe id="mobile-viewport" class="oe_mobile_viewport" src="#"></iframe>
</div> </div>
</div> </div>
</div> </div>