[FIX] web_tip: handles content changed event in forms; minor fixes
* eval tip on form content changes * prevent multiple tip trigerring in some cases * use scrollTo jquery plugin
This commit is contained in:
@@ -90,6 +90,9 @@
|
||||
var model = formView.model;
|
||||
var type = formView.datarecord.type ? formView.datarecord.type : null;
|
||||
var mode = 'form';
|
||||
formView.on('view_content_has_changed', self, function() {
|
||||
self.eval_tip(null, model, mode, type);
|
||||
});
|
||||
self.eval_tip(null, model, mode, type);
|
||||
},
|
||||
|
||||
@@ -136,7 +139,9 @@
|
||||
add_tip: function(tip) {
|
||||
var self = this;
|
||||
self.tip_mutex.exec(function() {
|
||||
return $.when(self.do_tip(tip));
|
||||
if (!tip.is_consumed) {
|
||||
return $.when(self.do_tip(tip));
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -175,8 +180,7 @@
|
||||
return (overflow === 'auto' || overflow === 'scroll');
|
||||
});
|
||||
if (scroll) {
|
||||
var offset = self.$element.offset().top;
|
||||
$(scroll).scrollTop(offset);
|
||||
$(scroll).scrollTo(self.$element);
|
||||
}
|
||||
|
||||
var _top = self.$element.offset().top -5;
|
||||
|
||||
Reference in New Issue
Block a user