| 49 | // interchangeably. In either case an element is returned. This allows us to |
| 50 | // do `Split([elem1, elem2])` as well as `Split(['#id1', '#id2'])`. |
| 51 | var elementOrSelector = function (el) { |
| 52 | if (isString(el)) { |
| 53 | var ele = document.querySelector(el); |
| 54 | if (!ele) { |
| 55 | throw new Error(("Selector " + el + " did not match a DOM element")) |
| 56 | } |
| 57 | return ele |
| 58 | } |
| 59 | |
| 60 | return el |
| 61 | }; |
| 62 | |
| 63 | // Helper function gets a property from the properties object, with a default fallback |
| 64 | var getOption = function (options, propName, def) { |