/dev_compiler_playground

Dart's dev_compiler playground - see what works and what does not

Primary LanguageJavaScript

Pantry-sort

Sort DOM elements by a configurable property

PantrySorter

Sorter class that uses DOM as a source of data and will sort the DOM Elements based on a user defined criteria

Kind: global class

new PantrySorter(baseElementSelector)

Param Type Description
baseElementSelector Element Selector to the base element, the childre on which will be sorted

Example

new PantrySorter(".sort-these").sort((a, b) => a.localeCompare(b), e => e.textContent );

pantrySorter.sort(comparator, compareBy)

Sort the DOM elements

Kind: instance method of PantrySorter

Param Type Description
comparator function Comperator function implementation
compareBy function The property by which the comparison should happen