demo/dist/demo.js
function setup(target) {
	      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
	      var targets = null;

	      if (is.empty(target) || is.string(target)) {
	        targets = Array.from(document.querySelectorAll(is.string(target) ? target : 'input[type="range"]'));
	      } else if (is.element(target)) {
	        targets = [target];
	      } else if (is.nodeList(target)) {
	        targets = Array.from(target);
	      } else if (is.array(target)) {
	        targets = target.filter(is.element);
	      }

	      if (is.empty(targets)) {
	        return null;
	      }

	      var config = Object.assign({}, defaults, options);

	      if (is.string(target) && config.watch) {
	        // Create an observer instance
	        var observer = new MutationObserver(function (mutations) {
	          Array.from(mutations).forEach(function (mutation) {
	            Array.from(mutation.addedNodes).forEach(function (node) {
	              if (!is.element(node) || !matches(node, target)) {
	                return;
	              } // eslint-disable-next-line no-unused-vars


	              var range = new RangeTouch(node, config);
	            });
	          });
	        }); // Pass in the target node, as well as the observer options

	        observer.observe(document.body, {
	          childList: true,
	          subtree: true
	        });
	      }

	      return targets.map(function (t) {
	        return new RangeTouch(t, options);
	      });
	    }
function setup(target) {
	      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
	      var targets = null;

	      if (is.empty(target) || is.string(target)) {
	        targets = Array.from(document.querySelectorAll(is.string(target) ? target : 'input[type="range"]'));
	      } else if (is.element(target)) {
	        targets = [target];
	      } else if (is.nodeList(target)) {
	        targets = Array.from(target);
	      } else if (is.array(target)) {
	        targets = target.filter(is.element);
	      }

	      if (is.empty(targets)) {
	        return null;
	      }

	      var config = Object.assign({}, defaults, options);

	      if (is.string(target) && config.watch) {
	        // Create an observer instance
	        var observer = new MutationObserver(function (mutations) {
	          Array.from(mutations).forEach(function (mutation) {
	            Array.from(mutation.addedNodes).forEach(function (node) {
	              if (!is.element(node) || !matches(node, target)) {
	                return;
	              } // eslint-disable-next-line no-unused-vars


	              var range = new RangeTouch(node, config);
	            });
	          });
	        }); // Pass in the target node, as well as the observer options

	        observer.observe(document.body, {
	          childList: true,
	          subtree: true
	        });
	      }

	      return targets.map(function (t) {
	        return new RangeTouch(t, options);
	      });
	    }
function setup ( target ) { var options = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ; var targets = null ; if ( is . empty ( target ) || is . string ( target ) ) { targets = Array . from ( document . querySelectorAll ( is . string ( target ) ? target : 'input[type="range"]' ) ) ; } else if ( is . element ( target ) ) { targets = [ target ] ; } else if ( is . nodeList ( target ) ) { targets = Array . from ( target ) ; } else if ( is . array ( target ) ) { targets = target . filter ( is . element ) ; } if ( is . empty ( targets ) ) { return null ; } var config = Object . assign ( { } , defaults , options ) ; if ( is . string ( target ) && config . watch ) { // Create an observer instance var observer = new MutationObserver ( function ( mutations ) { Array . from ( mutations ) . forEach ( function ( mutation ) { Array . from ( mutation . addedNodes ) . forEach ( function ( node ) { if ( ! is . element ( node ) || ! matches ( node , target ) ) { return ; } // eslint-disable-next-line no-unused-vars var range = new RangeTouch ( node , config ) ; } ) ; } ) ; } ) ; // Pass in the target node, as well as the observer options observer . observe ( document . body , { childList : true , subtree : true } ) ; } return targets . map ( function ( t ) { return new RangeTouch ( t , options ) ; } ) ; }
Setup multiple instances
@param {String|Element|NodeList|Array} target
@param {Object} options
Setup multiple instances