Skip to content

Update hideUnchanged/showUnchanged in Formatters doc so formatter arrows are shown  #206

@gterras

Description

@gterras

The current example in https://github.com/benjamine/jsondiffpatch/blob/master/docs/formatters.md does not trigger html arrows display.

This is the closest I've came up with to make it work :

  var delta = jsondiffpatch.diff(left, right);
  // left is optional, if specified unchanged values will be visible too

  var el = document.getElementById('the-diff');

 el.innerHTML = jsondiffpatch.formatters.html.format(delta, left);

  // Also you can dinamically show/hide unchanged values
  jsondiffpatch.formatters.html.hideUnchanged(el,10);
  jsondiffpatch.formatters.html.showUnchanged(true, el, 10);
  // these will also adjust array move arrows (SVG), which is useful if something alters the html layout

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions