UNPKG

jointjs

Version:

JavaScript diagramming library

4 lines 538 B
<pre class="docs-method-signature"><code>util.sortElements(elements, comparator)</code></pre><p>Change the order of <code>elements</code> (a collection of HTML elements or a selector or jQuery object) in the DOM according to the <code>comparator(elementA, elementB)</code> function. The <code>comparator</code> function has the exact same meaning as in <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort"><code>Array.prototype.sort(comparator)</code></a>. </p>