function createResizer(handler) {
	var maxSize = 1000000;

	// NOTE(SB) Don't use innerHTML because it could be considered unsafe.
	// https://github.com/chartjs/Chart.js/issues/5902
	var resizer = createDiv(CSS_SIZE_MONITOR);
	var expand = createDiv(CSS_SIZE_MONITOR + '-expand');
	var shrink = createDiv(CSS_SIZE_MONITOR + '-shrink');

	expand.appendChild(createDiv());
	shrink.appendChild(createDiv());

	resizer.appendChild(expand);
	resizer.appendChild(shrink);
	resizer._reset = function() {
		expand.scrollLeft = maxSize;
		expand.scrollTop = maxSize;
		shrink.scrollLeft = maxSize;
		shrink.scrollTop = maxSize;
	};

	var onScroll = function() {
		resizer._reset();
		handler();
	};

	addListener(expand, 'scroll', onScroll.bind(expand, 'expand'));
	addListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink'));

	return resizer;
}
function createResizer(handler) {
	var maxSize = 1000000;

	// NOTE(SB) Don't use innerHTML because it could be considered unsafe.
	// https://github.com/chartjs/Chart.js/issues/5902
	var resizer = createDiv(CSS_SIZE_MONITOR);
	var expand = createDiv(CSS_SIZE_MONITOR + '-expand');
	var shrink = createDiv(CSS_SIZE_MONITOR + '-shrink');

	expand.appendChild(createDiv());
	shrink.appendChild(createDiv());

	resizer.appendChild(expand);
	resizer.appendChild(shrink);
	resizer._reset = function() {
		expand.scrollLeft = maxSize;
		expand.scrollTop = maxSize;
		shrink.scrollLeft = maxSize;
		shrink.scrollTop = maxSize;
	};

	var onScroll = function() {
		resizer._reset();
		handler();
	};

	addListener(expand, 'scroll', onScroll.bind(expand, 'expand'));
	addListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink'));

	return resizer;
}
function createResizer ( handler ) { var maxSize = 1000000 ; // NOTE(SB) Don't use innerHTML because it could be considered unsafe. // https://github.com/chartjs/Chart.js/issues/5902 var resizer = createDiv ( CSS_SIZE_MONITOR ) ; var expand = createDiv ( CSS_SIZE_MONITOR + '-expand' ) ; var shrink = createDiv ( CSS_SIZE_MONITOR + '-shrink' ) ; expand . appendChild ( createDiv ( ) ) ; shrink . appendChild ( createDiv ( ) ) ; resizer . appendChild ( expand ) ; resizer . appendChild ( shrink ) ; resizer . _reset = function ( ) { expand . scrollLeft = maxSize ; expand . scrollTop = maxSize ; shrink . scrollLeft = maxSize ; shrink . scrollTop = maxSize ; } ; var onScroll = function ( ) { resizer . _reset ( ) ; handler ( ) ; } ; addListener ( expand , 'scroll' , onScroll . bind ( expand , 'expand' ) ) ; addListener ( shrink , 'scroll' , onScroll . bind ( shrink , 'shrink' ) ) ; return resizer ; }
Implementation based on https://github.com/marcj/css-element-queries
Implementation based on https : // github . com / marcj / css - element - queries
Creates a resizer div