Sha256: 1bb5708df636eee5a9c1fc87ad13142cdd1a21f188998188daf8fb02784591b2

Contents?: true

Size: 1.42 KB

Versions: 49

Compression:

Stored size: 1.42 KB

Contents

import {  root  } from './root';

export class RequestAnimationFrameDefinition {
  cancelAnimationFrame: (handle: number) => void;
  requestAnimationFrame: (cb: () => void) => number;
  constructor(root: any) {
    if (root.requestAnimationFrame) {
      this.cancelAnimationFrame = root.cancelAnimationFrame.bind(root);
      this.requestAnimationFrame = root.requestAnimationFrame.bind(root);
    } else if (root.mozRequestAnimationFrame) {
      this.cancelAnimationFrame = root.mozCancelAnimationFrame.bind(root);
      this.requestAnimationFrame = root.mozRequestAnimationFrame.bind(root);
    } else if (root.webkitRequestAnimationFrame) {
      this.cancelAnimationFrame = root.webkitCancelAnimationFrame.bind(root);
      this.requestAnimationFrame = root.webkitRequestAnimationFrame.bind(root);
    } else if (root.msRequestAnimationFrame) {
      this.cancelAnimationFrame = root.msCancelAnimationFrame.bind(root);
      this.requestAnimationFrame = root.msRequestAnimationFrame.bind(root);
    } else if (root.oRequestAnimationFrame) {
      this.cancelAnimationFrame = root.oCancelAnimationFrame.bind(root);
      this.requestAnimationFrame = root.oRequestAnimationFrame.bind(root);
    } else {
      this.cancelAnimationFrame = root.clearTimeout.bind(root);
      this.requestAnimationFrame = function(cb) { return root.setTimeout(cb, 1000 / 60); };
    }
  }
}

export const AnimationFrame = new RequestAnimationFrameDefinition(root);

Version data entries

49 entries across 49 versions & 4 rubygems

Version Path
govuk_publishing_components-16.21.0 node_modules/rxjs/src/util/AnimationFrame.ts
govuk_publishing_components-16.20.1 node_modules/rxjs/src/util/AnimationFrame.ts
govuk_publishing_components-16.20.0 node_modules/rxjs/src/util/AnimationFrame.ts
govuk_publishing_components-16.19.0 node_modules/rxjs/src/util/AnimationFrame.ts
govuk_publishing_components-16.18.0 node_modules/rxjs/src/util/AnimationFrame.ts
govuk_publishing_components-16.17.0 node_modules/rxjs/src/util/AnimationFrame.ts
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/inquirer/node_modules/rxjs/src/util/AnimationFrame.ts
locomotivecms-3.4.0 app/javascript/node_modules/rxjs/src/util/AnimationFrame.ts
dragonfly_puppeteer-0.1.0 node_modules/rxjs/src/util/AnimationFrame.ts