Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
};
onPagination() {
set(this, 'isLoadingMore', true);
this._super();
},
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);
},
onPagination(records) {
set(this, 'isLoading', false);
unshiftObjects(get(this, 'comments'), records.toArray().reverse());
invokeAction(this, 'trackEngagement', 'click');
},
get(this, 'getDataTask').perform(type).then((results) => {
set(this, `${type}Results`, results);
set(this, 'currentItems', results);
}).catch((error) => {
get(this, 'raven').captureException(error);
focusOut(event) {
set(this, 'aria-selected', 'false');
get(this, 'accordion').handlePanelEvent('onPanelTabFocusOut', get(this, 'panel'), event);
},
_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);
}
},
}).then((results) => {
const entry = get(results, 'firstObject');
set(controller, 'entry', entry);
if (entry !== undefined) {
set(controller, 'entry.media', media);
}
});
set(controller, 'entry', promise);
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(() => {});
},
onProgressChanged(progress) {
set(this, 'entry.progress', progress);
get(this, 'saveEntryDebounced').perform();
},