update not updating cmsettings.mode ?

82 views
Skip to first unread message

sch...@insight.com

unread,
May 18, 2016, 4:54:57 PM5/18/16
to Mergely
Hi.

Have the following snippet, which changes the mode to a value from a select list populated from meta.js:

            var $comparer = $('#diffViewerComparer');
            var options = $comparer.mergely('options');
            options.cmsettings.mode = vm.selectedMode.mime;
            $comparer.mergely('options', options);
            $comparer.mergely('update');

It doesn't appear to have any impact: the text highlighting stays with the convention that it was originally initiated with.


Any thoughts? Workarounds?

Thanks


Jamie Peabody

unread,
May 19, 2016, 12:58:50 PM5/19/16
to sch...@insight.com, Mergely
After the cmsettings are only used on initialization.  To tweak CodeMirror editors after init, use mergely-cm.  E.g. this will give you direct access to CodeMirror: $(selector).mergely('cm', 'rhs')


--
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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sch...@insight.com

unread,
May 19, 2016, 1:08:42 PM5/19/16
to Mergely, sch...@insight.com
That did the trick nicely. Thanks!
Reply all
Reply to author
Forward
0 new messages