this.$el.addClass("hidden");
- this.$modal = $(openerp.qweb.render('website.snippets_modal'));
- this.$modal.appendTo("body");
-
$(document).on('click', '.dropdown-submenu a[tabindex]', function (e) {
e.preventDefault();
});
});
},
stop: function(ev, ui){
- if (action === 'insert' && ! dropped && $('.oe_drop_zone') && ui.position.top > 50) {
+ if (action === 'insert' && ! dropped && $('.oe_drop_zone') && ui.position.top > 3) {
var el = $('.oe_drop_zone').nearest({x: ui.position.left, y: ui.position.top}).first();
if (el.length) {
el.after($toInsert);
},0);
} else {
$toInsert.remove();
- if (self.$modal.find('input:not(:checked)').length) {
- self.$modal.modal('toggle');
- }
}
},
});
</div>
</li>
</t>
- <t t-name="website.snippets_modal">
- <div class="modal" id="oe_droperror" tabindex="-1" role="dialog">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal">&times;</button>
- <h4 class="modal-title">
- Building Block Not Inserted
- </h4>
- </div>
- <div class="modal-body">
- <p>
- Please drop building blocks in a valid zone, like
- this one:
- </p>
- <div class="row">
- <div class="col-sm-4 col-sm-offset-4 oe_drop_zone_style text-center">
- <span class="mt16">drop in this zone</span>
- </div>
- </div>
- <div class="text-muted">
- <b>Tip:</b> when your cursor is in a valid zone,
- OpenERP shows you a preview of the building block
- in the page. You must release the block when the
- preview is visible.
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
- <div class="pull-left">
- <input type="checkbox" value="1"/> Never show this tip again
- </div>
- </div>
- </div>
- </div>
- </div>
- </t>
<t t-name="website.snippets">
<div id='oe_snippets'></div>