[IMP] website editor: bounce edit button

bzr revid: chm@openerp.com-20130918083324-kj75b0ufv6gita9b
This commit is contained in:
Christophe Matthieu 2013-09-18 10:33:24 +02:00
parent 23d04e1601
commit 888e51ae17
1 changed files with 12 additions and 0 deletions

View File

@ -5,7 +5,19 @@
website.templates.push('/website/static/src/xml/website.snippets.xml');
website.EditorBar.include({
start: function () {
var self = this;
$("body").on('click', function (event) {
var tag = event.srcElement.tagName.toLowerCase();
var $this = $(event.srcElement);
if (!(tag === 'a' || tag === "button") && !$this.parents("a, button").length) {
self.$('[data-action="edit"]').parent().effect('bounce', {distance: 18, times: 5}, 250);
}
});
return this._super();
},
edit: function () {
$("body").off('click');
var self = this;
window.snippets = this.snippets = new website.snippet.BuildingBlock(this);
this.snippets.appendTo(this.$el);