How to use the ember-metal/set function in ember-metal

To help you get started, we’ve selected a few ember-metal 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 Ticketfly / ember-ticketfly-accordion / addon / utils / accordion-panel-animation.js View on Github external
animation.onfinish = function _panelCloseOnfinish() {

    // Before removing the panel body element from the accessibility tree and hiding
    // setting it to `display: none`, we need to restore its measurements so that they
    // can be read properly on the next "show"
    panelBodyElem.animate(
      [
        { height: '0px', paddingTop: '0px', paddingBottom: '0px', visibility: 'hidden' },
        { height, paddingTop, paddingBottom, visibility: 'visible' }
      ],
      { duration: 0.0001, fill: 'forwards' }
    );

    if (!get(panelBodyComponent, 'isDestroyed')) {
      set(panelBodyComponent, 'isPanelExpanded', false);
      onComplete(panelComponent);
    }
  };
github hummingbird-me / hummingbird-client / app / components / search-results / group.js View on Github external
onPagination() {
      set(this, 'isLoadingMore', true);
      this._super();
    },
github Fabriquartz / ember-railio-grid / addon / components / data-grid.js View on Github external
let managedContent  = get(this, 'managedContent');

      if (selectionLength === get(managedContent, 'length')) {
        this.send('clearSelection');
        return;
      }

      let selectPage = get(this, 'selectPage');
      let page       = A(managedContent.slice(0));

      if (selectPage) {
        strictInvokeAction(this, 'selectPage', page);
        return;
      }

      set(this, '_selection', page);
    },
github hummingbird-me / hummingbird-client / app / components / stream-feed / items / post / comments.js View on Github external
onPagination(records) {
    set(this, 'isLoading', false);
    unshiftObjects(get(this, 'comments'), records.toArray().reverse());
    invokeAction(this, 'trackEngagement', 'click');
  },
github hummingbird-me / hummingbird-client / app / components / trending / -base.js View on Github external
get(this, 'getDataTask').perform(type).then((results) => {
      set(this, `${type}Results`, results);
      set(this, 'currentItems', results);
    }).catch((error) => {
      get(this, 'raven').captureException(error);
github Ticketfly / ember-ticketfly-accordion / addon / components / tf-accordion-panel-tab.js View on Github external
focusOut(event) {
    set(this, 'aria-selected', 'false');
    get(this, 'accordion').handlePanelEvent('onPanelTabFocusOut', get(this, 'panel'), event);
  },
github Ticketfly / ember-ticketfly-accordion / addon / components / tf-accordion.js View on Github external
_onPanelSelection(panel) {
      const panels = get(this, 'panels');
      const indexOfSelected = panels.indexOf(panel);
      const shouldExpand = !get(panel, 'isExpanded');
      const isAnimatable = get(this, 'isAnimatable');

      this._handleMultiExpandOnPanelSelect(indexOfSelected, panels, isAnimatable);

      scheduleOnce('afterRender', this, 'setFocusOnPanel', panel, indexOfSelected);

      if (isAnimatable && !get(panel, 'isInMotion')) {
        const animationFunc = shouldExpand ? 'animatePanelOpen' : 'animatePanelClosed';
        const animationCompleteCallback = shouldExpand ? 'onPanelAnimatedOpen' : 'onPanelAnimatedClosed';

        set(panel, 'isInMotion', true);
        get(this, animationFunc)(panel, get(this, animationCompleteCallback));

      } else {
        set(panel, 'isExpanded', shouldExpand);
      }
    },
github hummingbird-me / hummingbird-client / app / routes / media / show.js View on Github external
}).then((results) => {
      const entry = get(results, 'firstObject');
      set(controller, 'entry', entry);
      if (entry !== undefined) {
        set(controller, 'entry.media', media);
      }
    });
    set(controller, 'entry', promise);
github hummingbird-me / hummingbird-client / app / users / components / favorite-series / component.js View on Github external
get(this, 'getAllFavorites').perform().then(([anime, manga, chars]) => {
      set(this, 'animeFavorites', get(anime, 'value'));
      set(this, 'mangaFavorites', get(manga, 'value'));
      set(this, 'characterFavorites', get(chars, 'value'));
    }).catch(() => {});
  },
github hummingbird-me / hummingbird-client / app / components / users / library / library-entry.js View on Github external
onProgressChanged(progress) {
      set(this, 'entry.progress', progress);
      get(this, 'saveEntryDebounced').perform();
    },