diff --git a/examples/app.js b/examples/app.js index a759198..21ea38b 100644 --- a/examples/app.js +++ b/examples/app.js @@ -19,7 +19,7 @@ document.onreadystatechange = function () { return; } - new Mergely('#mergely', { + const doc = new Mergely('#mergely', { license: 'lgpl', ignorews: true, wrap_lines: true, @@ -38,4 +38,9 @@ document.onreadystatechange = function () { }, _debug: '' }); + + // On init, scroll to first diff + doc.once('updated', () => { + doc.scrollToDiff('next'); + }); }; diff --git a/examples/index.html b/examples/index.html index dc4a185..54b54ff 100644 --- a/examples/index.html +++ b/examples/index.html @@ -28,6 +28,9 @@ This example demonstrates the minimum amount of code required to use Mergely.