[IMP] Improved scrolling when scrolltop/scrollleft are not in range for bounce button.

bzr revid: jra@tinyerp.com-20120711133124-j84maefl1b21i2jo
This commit is contained in:
Jiten (OpenERP) 2012-07-11 19:01:24 +05:30
parent 90eced57d2
commit a899b40b59
2 changed files with 9 additions and 0 deletions

View File

@ -291,6 +291,12 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
$(".oe_form_button_edit").wrap(div);
$("#bounce").addClass('oe_bounce_button_left');
var edit_btn = $(".oe_form_button_edit");
if (jQuery(window).scrollTop() > 75 ) {
$('body,html').animate({ scrollTop: 0 }, 200);
}
if (jQuery(window).scrollLeft() > 225 ) {
$('body,html').animate({ scrollLeft: 0 }, 200);
}
self.do_bounce(edit_btn);
e.stopImmediatePropagation();
});

View File

@ -418,6 +418,9 @@ instance.web_kanban.KanbanGroup = instance.web.OldWidget.extend({
var add_btn = this.$element.find('.oe_kanban_add');
this.$records.click(function (ev) {
if (ev.target == ev.currentTarget) {
if (jQuery(window).scrollTop() > 120 ) {
$('body,html').animate({ scrollTop: 0 }, 200);
}
self.view.do_bounce(add_btn);
}
});