mirror of
https://github.com/wickedest/Mergely.git
synced 2026-03-20 09:38:39 +08:00
Fixes autoupdate issue to ensure there is no update if scrolled or resized.
This commit is contained in:
@@ -460,7 +460,9 @@ jQuery.extend(Mgly.mergely.prototype, {
|
||||
if (self.settings.resize) self.settings.resize();
|
||||
self.editor[self.id + '-lhs'].refresh();
|
||||
self.editor[self.id + '-rhs'].refresh();
|
||||
self._changing(self.id + '-lhs', self.id + '-rhs');
|
||||
if (self.settings.autoupdate) {
|
||||
self._changing(self.id + '-lhs', self.id + '-rhs');
|
||||
}
|
||||
}
|
||||
jQuery(window).resize(
|
||||
function () {
|
||||
@@ -710,15 +712,16 @@ jQuery.extend(Mgly.mergely.prototype, {
|
||||
scroller.scrollTop(top_to - top_adjust).scrollLeft(left_to);
|
||||
}
|
||||
else this.trace('scroll', 'not scrolling other side');
|
||||
|
||||
var timer = new Mgly.Timer();
|
||||
this._calculate_offsets(editor_name1, editor_name2, this.changes);
|
||||
this.trace('change', 'offsets time', timer.stop());
|
||||
this._markup_changes(editor_name1, editor_name2, this.changes);
|
||||
this.trace('change', 'markup time', timer.stop());
|
||||
this._draw_diff(editor_name1, editor_name2, this.changes);
|
||||
this.trace('change', 'draw time', timer.stop());
|
||||
|
||||
|
||||
if (this.settings.autoupdate) {
|
||||
var timer = new Mgly.Timer();
|
||||
this._calculate_offsets(editor_name1, editor_name2, this.changes);
|
||||
this.trace('change', 'offsets time', timer.stop());
|
||||
this._markup_changes(editor_name1, editor_name2, this.changes);
|
||||
this.trace('change', 'markup time', timer.stop());
|
||||
this._draw_diff(editor_name1, editor_name2, this.changes);
|
||||
this.trace('change', 'draw time', timer.stop());
|
||||
}
|
||||
this.trace('scroll', 'scrolled');
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user