npm install
npm start
Go to localhost:8080
function waitForElm(selector) { | |
return new Promise(resolve => { | |
if (document.querySelector(selector)) { | |
return resolve(document.querySelector(selector)); | |
} | |
const observer = new MutationObserver(mutations => { | |
if ((document.querySelector(selector) !== undefined) && | |
(document.querySelector(selector) !== null)) { | |
resolve(document.querySelector(selector)); |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
Services.factory("LawnchairFactory", function($window, $log, $parse) { | |
return function(name, config) { | |
var collection = {}; | |
var array = []; | |
var isArray = config && config.isArray; | |
var idGetter = $parse((config && config.entryKey) ? config.entryKey : "id"); | |
var transformSave = (config && config.transformSave) ? config.transformSave : angular.identity; | |
var transformLoad = (config && config.transformLoad) ? config.transformLoad : angular.identity; | |
function getEntryId(entry){ |
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// | |
// This is a options template for [JSHint][1], using [JSHint example][2] | |
// and [Ory Band's example][3] as basis and setting config values to | |
// be most strict: | |
// | |
// * set all enforcing options to true |