How to use the aurelia-pal.DOM.createCustomEvent function in aurelia-pal

To help you get started, we’ve selected a few aurelia-pal 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 aurelia / templating-resources / test / focus.spec.ts View on Github external
it('should set focus value to false when element loses focus', () => {
        focus.attached();
        setBindedFocusValue(true);

        otherElement.focus();
        element.dispatchEvent(DOM.createCustomEvent('blur'));

        expect(focus.value).toBe(false);
    });
github aurelia / fetch-client / dist / es2015 / aurelia-fetch-client.js View on Github external
function trackRequestStart(client) {
    client.isRequesting = !!(++client.activeRequestCount);
    if (client.isRequesting) {
        let evt = DOM.createCustomEvent('aurelia-fetch-client-request-started', { bubbles: true, cancelable: true });
        setTimeout(() => DOM.dispatchEvent(evt), 1);
    }
}
function trackRequestEnd(client) {
github aurelia / fetch-client / src / http-client.ts View on Github external
function trackRequestStart(client: HttpClient) {
  client.isRequesting = !!(++client.activeRequestCount);
  if (client.isRequesting) {
    let evt = DOM.createCustomEvent('aurelia-fetch-client-request-started', { bubbles: true, cancelable: true });
    setTimeout(() => DOM.dispatchEvent(evt), 1);
  }
}
github aurelia / fetch-client / dist / aurelia-fetch-client.js View on Github external
function trackRequestStart() {
  this.isRequesting = !!(++this.activeRequestCount);
  if (this.isRequesting) {
    let evt = DOM.createCustomEvent('aurelia-fetch-client-request-started', { bubbles: true, cancelable: true });
    setTimeout(() => DOM.dispatchEvent(evt), 1);
  }
}
github aurelia / http-client / src / http-client.js View on Github external
function trackRequestEnd(client: HttpClient, processor: RequestMessageProcessor) {
  let index = client.pendingRequests.indexOf(processor);

  client.pendingRequests.splice(index, 1);
  client.isRequesting = client.pendingRequests.length > 0;

  if (!client.isRequesting) {
    let evt = DOM.createCustomEvent('aurelia-http-client-requests-drained', { bubbles: true, cancelable: true });
    setTimeout(() => DOM.dispatchEvent(evt), 1);
  }
}
github aurelia / http-client / src / http-client.js View on Github external
function trackRequestEnd(client: HttpClient, processor: RequestMessageProcessor) {
  let index = client.pendingRequests.indexOf(processor);

  client.pendingRequests.splice(index, 1);
  client.isRequesting = client.pendingRequests.length > 0;

  if (!client.isRequesting) {
    let evt = DOM.createCustomEvent('aurelia-http-client-requests-drained', { bubbles: true, cancelable: true });
    setTimeout(() => DOM.dispatchEvent(evt), 1);
  }
}
github aurelia / ux / dist / native-modules / chip-input / ux-chip-input.js View on Github external
UxChipInput.prototype.attached = function () {
        var _this = this;
        var blurEvent = DOM.createCustomEvent('blur', { bubbles: true });
        this.textbox.addEventListener('focus', function () {
            _this.element.classList.add('focused');
        });
        this.textbox.addEventListener('blur', function () {
            _this.addChip();
            _this.element.classList.remove('focused');
            _this.element.dispatchEvent(blurEvent);
        });
    };
    UxChipInput.prototype.detached = function () {
github aurelia / ux / packages / chip-input / dist / native-modules / ux-chip-input.js View on Github external
UxChipInput.prototype.attached = function () {
        var _this = this;
        var blurEvent = DOM.createCustomEvent('blur', { bubbles: true });
        this.textbox.addEventListener('focus', function () {
            _this.element.classList.add('ux-chip-input--focused');
        });
        this.textbox.addEventListener('blur', function () {
            _this.addChip();
            _this.element.classList.remove('ux-chip-input--focused');
            _this.element.dispatchEvent(blurEvent);
        });
    };
    UxChipInput.prototype.detached = function () {
github aurelia / ux / packages / chip-input / dist / native-modules / index.js View on Github external
UxChipInput.prototype.attached = function () {
        var _this = this;
        var blurEvent = DOM.createCustomEvent('blur', { bubbles: true });
        this.textbox.addEventListener('focus', function () {
            _this.element.classList.add('ux-chip-input--focused');
        });
        this.textbox.addEventListener('blur', function () {
            _this.addChip();
            _this.element.classList.remove('ux-chip-input--focused');
            _this.element.dispatchEvent(blurEvent);
        });
    };
    UxChipInput.prototype.detached = function () {
github aurelia / ux / packages / checkbox / src / ux-checkbox.ts View on Github external
public setChecked(value: any) {
    const oldValue = this.checked;
    const newValue = !!value;

    if (newValue !== oldValue) {
      this.checked = newValue;
      this.ignoreValueChanges = true;
      this.value = newValue;
      this.ignoreValueChanges = false;
      this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true }));
    }
  }

aurelia-pal

Aurelia's platform abstraction layer (PAL).

MIT
Latest version published 6 years ago

Package Health Score

53 / 100
Full package analysis