[IMP]Implement effect on close tour like smartsheet.

bzr revid: kch@tinyerp.com-20140407084358-xnfsn6vsnnqy3lzf
This commit is contained in:
Kunal Chavda (Open ERP) 2014-04-07 14:13:58 +05:30
parent de380aa914
commit e06a7036f1
1 changed files with 24 additions and 6 deletions

View File

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