How to use the es6-object-assign.assign function in es6-object-assign

To help you get started, we’ve selected a few es6-object-assign examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appleple / pretty-scroll / src / core / index.js View on Github external
constructor(ele, option) {
    this.opt = assign({}, defaults, option);
    this.scrollAmount = -this.opt.offsetTop;
    this.scrollOld = 0;
    this.containerElement = typeof this.opt.container === 'string' ? document.querySelector(this.opt.container) : this.opt.container;
    this.targetElement = typeof ele === 'string' ? document.querySelector(ele) : ele;
    this.targetWidth = this.targetElement.style.width;
    this.targetBoxSizing = this.targetElement.style.boxSizing;
    before(this.targetElement, '<div class="js-pretty-scroll-before"></div>');
    this.beforeElement = this.targetElement.previousElementSibling;
    this.parentElement = this.targetElement.parentElement;
    this.parentElement.style.position = 'relative';
    window.addEventListener('scroll', () =&gt; {
      this.onScroll();
    });
    window.addEventListener('resize', () =&gt; {
      this.onScroll();
    });
github appleple / lookforward / js / jquery-lookforward.js View on Github external
function LookForward(selector) {
    var _this = this;

    var options = arguments.length &gt; 1 &amp;&amp; arguments[1] !== undefined ? arguments[1] : {};

    _classCallCheck(this, LookForward);

    this.options = assign({}, defaults, options);
    this.id = (0, _util.getUniqId)();
    var eles = typeof selector === 'string' ? document.querySelectorAll(selector) : selector;
    var body = document.querySelector('body');
    this.currentUrl = location.href;
    this.selector = selector;
    this.historyLength = 0;
    if (!eles) {
      return;
    }
    [].forEach.call(eles, function (ele) {
      _this.addClickEvent(ele);
    });
    (0, _util.append)(body, '<div id="' + this.id + '"></div>');
    if (window.history &amp;&amp; this.options.useHistoryApi) {
      window.addEventListener('popstate', function (event) {
        var state = event.state;
github appleple / lookforward / src / core / index.js View on Github external
constructor(selector, options = {}) {
    this.options = assign({}, defaults, options);
    this.id = getUniqId();
    const eles = typeof selector === 'string' ? document.querySelectorAll(selector) : selector;
    const body = document.querySelector('body');
    this.currentUrl = location.href;
    this.selector = selector;
    this.historyLength = 0;
    if (!eles) {
      return;
    }
    [].forEach.call(eles, (ele) =&gt; {
      this.addClickEvent(ele);
    });
    append(body, `<div id="${this.id}"></div>`);
    if (window.history &amp;&amp; this.options.useHistoryApi) {
      window.addEventListener('popstate', (event) =&gt; {
        const state = event.state;
github appleple / lookforward / lib / core / index.js View on Github external
function LookForward(selector) {
    var _this = this;

    var options = arguments.length &gt; 1 &amp;&amp; arguments[1] !== undefined ? arguments[1] : {};

    _classCallCheck(this, LookForward);

    this.options = assign({}, defaults, options);
    this.id = (0, _util.getUniqId)();
    var eles = typeof selector === 'string' ? document.querySelectorAll(selector) : selector;
    var body = document.querySelector('body');
    this.currentUrl = location.href;
    this.selector = selector;
    this.historyLength = 0;
    if (!eles) {
      return;
    }
    [].forEach.call(eles, function (ele) {
      _this.addClickEvent(ele);
    });
    (0, _util.append)(body, '<div id="' + this.id + '"></div>');
    if (window.history &amp;&amp; this.options.useHistoryApi) {
      window.addEventListener('popstate', function (event) {
        var state = event.state;
github appleple / modal-video / js / modal-video.js View on Github external
function ModalVideo(ele, option) {
    var _this = this;

    _classCallCheck(this, ModalVideo);

    var opt = assign({}, defaults, option);
    var selectors = typeof ele === 'string' ? document.querySelectorAll(ele) : ele;
    var body = document.querySelector('body');
    var classNames = opt.classNames;
    var speed = opt.animationSpeed;
    [].forEach.call(selectors, function (selector) {
      selector.addEventListener('click', function (event) {
        if (selector.tagName === 'A') {
          event.preventDefault();
        }
        var videoId = selector.dataset.videoId;
        var channel = selector.dataset.channel || opt.channel;
        var id = (0, _util.getUniqId)();
        var videoUrl = selector.dataset.videoUrl || _this.getVideoUrl(opt, channel, videoId);
        var html = _this.getHtml(opt, videoUrl, id);
        (0, _util.append)(body, html);
        var modal = document.getElementById(id);
github appleple / pretty-scroll / js / pretty-scroll.js View on Github external
function PrettyScroll(ele, option) {
    var _this = this;

    _classCallCheck(this, PrettyScroll);

    this.opt = assign({}, defaults, option);
    this.scrollAmount = -this.opt.offsetTop;
    this.scrollOld = 0;
    this.containerElement = typeof this.opt.container === 'string' ? document.querySelector(this.opt.container) : this.opt.container;
    this.targetElement = typeof ele === 'string' ? document.querySelector(ele) : ele;
    this.targetWidth = this.targetElement.style.width;
    this.targetBoxSizing = this.targetElement.style.boxSizing;
    (0, _util.before)(this.targetElement, '<div class="js-pretty-scroll-before"></div>');
    this.beforeElement = this.targetElement.previousElementSibling;
    this.parentElement = this.targetElement.parentElement;
    this.parentElement.style.position = 'relative';
    window.addEventListener('scroll', function () {
      _this.onScroll();
    });
    window.addEventListener('resize', function () {
      _this.onScroll();
    });
github appleple / pretty-scroll / js / jquery-pretty-scroll.js View on Github external
function PrettyScroll(ele, option) {
    var _this = this;

    _classCallCheck(this, PrettyScroll);

    this.opt = assign({}, defaults, option);
    this.scrollAmount = -this.opt.offsetTop;
    this.scrollOld = 0;
    this.containerElement = typeof this.opt.container === 'string' ? document.querySelector(this.opt.container) : this.opt.container;
    this.targetElement = typeof ele === 'string' ? document.querySelector(ele) : ele;
    this.targetWidth = this.targetElement.style.width;
    this.targetBoxSizing = this.targetElement.style.boxSizing;
    (0, _util.before)(this.targetElement, '<div class="js-pretty-scroll-before"></div>');
    this.beforeElement = this.targetElement.previousElementSibling;
    this.parentElement = this.targetElement.parentElement;
    this.parentElement.style.position = 'relative';
    window.addEventListener('scroll', function () {
      _this.onScroll();
    });
    window.addEventListener('resize', function () {
      _this.onScroll();
    });
github appleple / lookforward / js / lookforward.js View on Github external
function LookForward(selector) {
    var _this = this;

    var options = arguments.length &gt; 1 &amp;&amp; arguments[1] !== undefined ? arguments[1] : {};

    _classCallCheck(this, LookForward);

    this.options = assign({}, defaults, options);
    this.id = (0, _util.getUniqId)();
    var eles = typeof selector === 'string' ? document.querySelectorAll(selector) : selector;
    var body = document.querySelector('body');
    this.currentUrl = location.href;
    this.selector = selector;
    this.historyLength = 0;
    if (!eles) {
      return;
    }
    [].forEach.call(eles, function (ele) {
      _this.addClickEvent(ele);
    });
    (0, _util.append)(body, '<div id="' + this.id + '"></div>');
    if (window.history &amp;&amp; this.options.useHistoryApi) {
      window.addEventListener('popstate', function (event) {
        var state = event.state;
github appleple / modal-video / lib / core / index.js View on Github external
function ModalVideo(ele, option) {
    var _this = this;

    _classCallCheck(this, ModalVideo);

    var opt = assign({}, defaults, option);
    var selectors = typeof ele === 'string' ? document.querySelectorAll(ele) : ele;
    var body = document.querySelector('body');
    var classNames = opt.classNames;
    var speed = opt.animationSpeed;
    [].forEach.call(selectors, function (selector) {
      selector.addEventListener('click', function (event) {
        if (selector.tagName === 'A') {
          event.preventDefault();
        }
        var videoId = selector.dataset.videoId;
        var channel = selector.dataset.channel || opt.channel;
        var id = (0, _util.getUniqId)();
        var videoUrl = selector.dataset.videoUrl || _this.getVideoUrl(opt, channel, videoId);
        var html = _this.getHtml(opt, videoUrl, id);
        (0, _util.append)(body, html);
        var modal = document.getElementById(id);
github appleple / modal-video / src / core / index.js View on Github external
constructor(ele, option) {
    const opt = assign({}, defaults, option);
    const selectors = typeof ele === 'string' ? document.querySelectorAll(ele) : ele;
    const body = document.querySelector('body');
    const classNames = opt.classNames;
    const speed = opt.animationSpeed;
    [].forEach.call(selectors, (selector) => {
      selector.addEventListener('click', (event) => {
        if (selector.tagName === 'A') {
          event.preventDefault();
        }
        const videoId = selector.dataset.videoId;
        const channel = selector.dataset.channel || opt.channel;
        const id = getUniqId();
        const videoUrl = selector.dataset.videoUrl || this.getVideoUrl(opt, channel, videoId);
        const html = this.getHtml(opt, videoUrl, id);
        append(body, html);
        const modal = document.getElementById(id);

es6-object-assign

ECMAScript 2015 (ES6) Object.assign polyfill and ponyfill

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis

Popular es6-object-assign functions