Multiple diff

51 views
Skip to first unread message

je...@timble.net

unread,
Nov 24, 2016, 10:44:16 PM11/24/16
to Mergely
I was trying multiple instance of mergely 

$('#compare-1').mergely()

<div id="compare-1"></div>
$('#compare-2').mergely()

<div id="compare-2"></div>


But the rendered editors results to

<div id="compare-1">
   
<div>
       
<div id="compare-2></div>
   
</div>
</div>


Jamie Peabody

unread,
Nov 25, 2016, 2:23:04 AM11/25/16
to je...@timble.net, Mergely
Is it possible that you are missing a closing HTML element somewhere? e.g.

<div id="compare-1"><div>
<div id="compare-2"></div>

Jamie
--
You received this message because you are subscribed to the Google Groups "Mergely" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mergely+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

je...@timble.net

unread,
Nov 25, 2016, 3:33:48 AM11/25/16
to Mergely
@jamie Yep, you're correct, thanks

je...@timble.net

unread,
Nov 25, 2016, 3:40:24 AM11/25/16
to Mergely
Also, is it possible to pass additional parameter (or something) to the left/right hand editor e.g. an Entity ID? So that after merge of either side the user can update the corresponding entity in the database.


On Friday, November 25, 2016 at 11:44:16 AM UTC+8, je...@timble.net wrote:

Jamie Peabody

unread,
Nov 25, 2016, 3:47:05 AM11/25/16
to je...@timble.net, Mergely
There are a couple of ways to do it.  One way is to allow the user to edit, and then provide a "Save" button that will get the updated values from lhs/rhs.

If you want more dynamic updates, then you would need to get the CodeMirror editor for each side: http://www.mergely.com/doc#mergely-cm, and then register change events (http://codemirror.net/doc/manual.html#events).  The problem with this approach is that updates can be frequent, so you will asynchronously hammer your backend.  The asynchronous nature of it means that the events can be processed in any order.  Not so nice.

Reply all
Reply to author
Forward
0 new messages