Mergely icon indicating copy to clipboard operation
Mergely copied to clipboard

scrolling one side before changes are computed

Open jgrocha opened this issue 10 years ago • 2 comments

Hi,

Thanks for this great tool. I'm loading one side and I disable the difference calculation. I only enable the difference calculation after loading the second text, because it does not make sense to show the difference between a text and an empty one. There is only a small problem, because if the user tries to scroll down the first text, before loading the second one, there is a Javascript error.

I fixed it (just a hack), in _scrolling, by adding:

if (!this.hasOwnProperty('changes')) return;

before the cycle where the property changes is used.

If this hack makes sense, I can submit a pull request.

jgrocha avatar Feb 13 '15 00:02 jgrocha

Hi Jorge,

Glad you like Mergely. Have you tried disabling autoupdate http://www.mergely.com/doc#autoupdate? It should disable the difference calculation.

Jamie

On 13 February 2015 at 00:31, Jorge Gustavo Rocha [email protected] wrote:

Hi,

Thanks for this great tool. I'm loading one side and I disable the difference calculation. I only enable the difference calculation after loading the second text, because it does not make sense to show the difference between a text and an empty one. There is only a small problem, because if the user tries to scroll down the first text, before loading the second one, there is a Javascript error.

I fixed it (just a hack), in _scrolling, by adding:

if (!this.hasOwnProperty('changes')) return;

before the cycle where the property changes is used.

If this hack makes sense, I can submit a pull request.

— Reply to this email directly or view it on GitHub https://github.com/wickedest/Mergely/issues/20.

wickedest avatar Feb 13 '15 09:02 wickedest

Hi Jamie,

Yes, I disabled the difference calculation, but was not enough. To disable the difference calculation, I had to do:

$(idsec).mergely('options', {autoupdate: false, change_timeout: 3600000});

After loading the rhs text, to enable back the difference calculation, I revert the settings:

$(idsec).mergely('options', {autoupdate: true, change_timeout: 150});

Regards!

jgrocha avatar Feb 15 '15 19:02 jgrocha