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 () {
$('body').addClass('oe_stop_scrolling');
// Firefox hack: document.getElementById("mobile-viewport").src = window.location.href + "?";
// TODO: disable scrollbar in iframe instead of forbidding scrolling
var iframeBody = $("#mobile-viewport").contents().find("body");
//iframeBody.css("overflow-y", "hidden");
document.getElementById("mobile-viewport").src = window.location.href + "?mobile-preview=true";
},
});
@ -332,13 +330,13 @@
// setup widget and drag and drop
start_snippets: function(){
var self = this;
this.$('.oe_snippet').draggable({
helper: 'clone',
appendTo: 'body',
start: function(){
var snippet = $(this);
self.activate_drop_zones({
siblings: snippet.data('selector-siblings'),
childs: snippet.data('selector-childs')
@ -346,7 +344,7 @@
$('.oe_drop_zone').droppable({
over: function(){
// FIXME: stupid hack to prevent multiple droppable to activate at once ...
// FIXME: stupid hack to prevent multiple droppable to activate at once ...
// it's not even working properly but it's better than nothing.
$(".oe_drop_zone.oe_hover").removeClass("oe_hover");
$(this).addClass("oe_hover");
@ -376,7 +374,7 @@
var child_selector = selector.childs || '';
var sibling_selector = selector.siblings || '';
var zone_template = "<div class='oe_drop_zone'></div>";
$('.oe_drop_zone').remove();
if(child_selector){
@ -386,7 +384,7 @@
$zones.eq(i).prepend(zone_template);
}
}
if(sibling_selector){
var $zones = $(sibling_selector);
for( var i = 0, len = $zones.length; i < len; i++ ){
@ -612,7 +610,7 @@
if(!$pagination.size()) {
return;
}
var page_count = $col.data('page_count');
var scope = $pagination.last().find("li").size()-2;
var kanban_url_col = $pagination.find("li a:first").attr("href").replace(/[0-9]+$/, '');
@ -679,7 +677,7 @@
dom_ready.then(function () {
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);
}

View File

@ -45,7 +45,7 @@
</div>
<div class="modal-body">
<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>