[MERGE] [IMP] website: tour: nice smooth cool and sexy effect when closing

or ending the tour.

bzr revid: tde@openerp.com-20140417162820-bdcpdenddqxzj949
This commit is contained in:
Kunal Chavda 2014-04-17 18:28:20 +02:00 committed by Thibault Delavallée
commit 3452694885
1 changed files with 24 additions and 6 deletions

View File

@ -297,13 +297,31 @@ website.Tour = openerp.Class.extend({
$(".popover.tour button") $(".popover.tour button")
.off() .off()
.on("click", function () { .on("click", function () {
$(".popover.tour").remove(); var help = $("#help-menu-button");
var offset = help.offset();
var left = (offset.left > 0) ? (offset.left + help.width()) : offset.left;
var top = (help.height() > 0) ? (offset.top + help.height()) : offset.top;
if ($(this).is("[data-role='next']") && step.element) {
$(".popover.tour").remove();
}
if (step.busy) return; if (step.busy) return;
if (!$(this).is("[data-role='next']")) { if (!$(this).is("[data-role='next']") || !step.element) {
clearTimeout(self.timer); $('.popover.tour')
step.busy = true; .animate({
self.tour.end(); left: left,
self.endTour(callback); top: top,
width: '1px',
height: '1px',
opacity: 0
}, 800,
function(){
$(".popover.tour").remove();
clearTimeout(self.timer);
step.busy = true;
self.tour.end();
self.endTour(callback);
});
} }
}); });