wickedest / Mergely

Merge and diff documents online
http://www.mergely.com
Other
1.17k stars 228 forks source link

scrolling one side before changes are computed #20

Open jgrocha opened 9 years ago

jgrocha commented 9 years ago

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.

wickedest commented 9 years ago

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 notifications@github.com 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.

jgrocha commented 9 years ago

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!