spotlightRight: function (sender, ev) { if (!this.preventKeyNavigation && this.toIndex !== null) { this.queuedIndex = this.toIndex + 1; //queuedIndex could have out boundary value. It will be managed in setIndex() } var orig = ev.originator, idx = this.getPanelIndex(orig), next = this.getPanels()[idx + 1], target = this.getSpotlightTarget('RIGHT', orig); if (target && target.parent instanceof ApplicationCloseButton) { Spotlight.spot(target); return true; } else if (next && orig instanceof Panel) { if (this.useHandle === true && this.handleShowing && idx == this.index) { Spotlight.spot(this.$.showHideHandle); return true; } else { if (!this.preventKeyNavigation) { this.next(); return true; } } } },
spotlightLeft: function (sender, ev) { if (!this.preventKeyNavigation && !this.leftKeyToBreadcrumb && this.toIndex !== null) { this.queuedIndex = this.toIndex - 1; //queuedIndex could have out boundary value. It will be managed in setIndex() } var orig = ev.originator, idx = this.getPanelIndex(orig), target = this.getSpotlightTarget('LEFT', orig); if (target && target.parent instanceof ApplicationCloseButton) { Spotlight.spot(target); return true; } else if (orig instanceof Panel) { if (idx === 0) { if (!this.preventKeyNavigation && this.showing && (this.useHandle === true) && this.handleShowing) { this.hide(); return true; } } else if (!this.leftKeyToBreadcrumb) { if (!this.preventKeyNavigation) { this.previous(); } else { Spotlight.spot(Spotlight.getLastControl()); } return true; } } },
showingChanged: function (inOldValue) { if (this.$.backgroundScrim) { this.$.backgroundScrim.addRemoveClass('visible', this.showing); } if (this.useHandle === true) { if (this.$.appClose) this.$.appClose.set('showing', (this.showing && this.hasCloseButton)); if (this.showing) { this.unstashHandle(); this._show(); Spotlight.spot(this.getActive()); } else { // in this case, our display flag will have been set to none so we need to clear // that even though the showing flag will remain false this.applyStyle('display', null); this.resetHandleAutoHide(); this._hide(); } this.sendShowingChangedEvent(inOldValue); } else { Panels.prototype.showingChanged.apply(this, arguments); } },
spotFirstVisibleChild: function() { var fv = this.getFullyVisibleItems()[0] || this.getVisibleItems()[0]; if (fv) { Spotlight.spot(fv); return true; } }
backKeyHandler: function (entry) { console.log('backKeyHandler|entry',entry); //document.getElementById('title_search').innerHTML = ' BACK isPreview '+sessionStorage.getItem('isPreview')+' previousP: '+this.get('previousPanel')+' next:'+entry.nextPanel+' previous '+entry.previousPanel+' | '+document.getElementById('title_search').innerHTML; if(typeof this.$['DisconnectedPanel'] !=='undefined'){ this.$['DisconnectedPanel'].destroy(); if(typeof this.$[this.get('previousPanel')] !=='undefined') { this.$[this.get('previousPanel')].show(); } } if(typeof this.$[entry.nextPanel]!='undefined'){ this.$[entry.nextPanel].destroy(); } if(typeof this.$[entry.previousPanel]!='undefined'){ console.log(entry.previousPanel); this.set('previousPanel',entry.previousPanel); this.$[entry.previousPanel].show(); console.log('last Control',Spotlight.getLastControl()); if(typeof entry.lastFocus !=="undefined") { Spotlight.spot(entry.lastFocus); } } return true; },
rightHandler: function(sender, event) { var panels = this.owner; if (this.index+1 == panels.index) { Spotlight.spot(panels.getActive()); return true; } }
capturedSpotlightFocus: function (sender, e) { // We need to prevent header children below the drawer from being focused if (e.originator.isDescendantOf(this.$.drawer.parent) && !e.originator.isDescendantOf(this.$.drawer)) { Spotlight.spot(this.$.drawer); return true; } },
drawerClosed: function (rendered) { if (this.generated && !rendered) { Spotlight.spot(this.$.activator); } this.bubble('onRequestUnmuteTooltip'); if (!rendered) this.doHidden(); },
drawerSpotDown: function (sender, event) { if (this.lockBottom && event.originator == this.$.drawer && event._originator) { // Spotlight containers redispatch 5-way events with the original event originator // saved as _originator which we'll use to respot if lockBottom === true Spotlight.spot(event._originator); return true; } },
handleSpotLeft: function () { if (this.showing) { Spotlight.spot(this.getActive()); } else { Spotlight.unspot(); } return true; },
keyup: function (inSender, inEvent) { var KEY_POINTER_PAGE_UP = 33, KEY_POINTER_PAGE_DOWN = 34; if (!this.getHandlePageUpDownKey()) { return; } var strategy = this.getStrategy(), showVertical = strategy.showVertical(), viewportBounds = strategy.$.viewport.getAbsoluteBounds(), oSpotControl = Spotlight.getCurrent(), direction, rDirection, pageKeyCtr; switch (inEvent.keyCode) { case KEY_POINTER_PAGE_UP: direction = showVertical ? 'Up' : 'Left'; rDirection = showVertical ? 'Down' : 'Right'; break; case KEY_POINTER_PAGE_DOWN: direction = showVertical ? 'Down' : 'Right'; rDirection = showVertical ? 'Up' : 'Left'; break; default: return; } pageKeyCtr = strategy.$['page' + direction + 'Control']; if (!Spotlight.getPointerMode() && oSpotControl) { var oSpotBounds = oSpotControl.getAbsoluteBounds(), oEndPoint = this.getEndPoint(direction, oSpotBounds, viewportBounds); var oControl = Spotlight. NearestNeighbor. getNearestPointerNeighbor(this, rDirection.toUpperCase(), oEndPoint.x, oEndPoint.y); if (oControl && oControl.id === oSpotControl.id) { oEndPoint = this.getEndPoint(direction, oSpotBounds, this.getNextViewport(direction, viewportBounds)); oControl = Spotlight. NearestNeighbor. getNearestPointerNeighbor(this, rDirection.toUpperCase(), oEndPoint.x, oEndPoint.y); } if (oControl !== oSpotControl) { Spotlight.spot(oControl); } else { pageKeyCtr.sendPaginateEvent(); } } else { if (pageKeyCtr.getDisabled()) { strategy.alertThumbs(); } else { pageKeyCtr.sendPaginateEvent(); } } },
transform:function(data){ if(this.get('showErrorApi') && data == Config.error._ERR_API){ this.set('retryCollection',this.data); this.data.set('errorCode',0); this.$.hot_event_notify_error_api.show(); Spotlight.spot(this.$.back_btn_error_api); return; } }
spotlightFromCloseButton: function (sender, ev) { var p = this.getActive(), idx = this.getPanelIndex(p), direction = ev.type.substring(11).toUpperCase(), // Derive direction from type target = Spotlight.NearestNeighbor.getNearestNeighbor(direction, ev.originator, {root: p}); if (target) { Spotlight.spot(target); return true; } else if (direction == 'RIGHT') { if (this.useHandle === true && this.handleShowing && idx == this.index) { Spotlight.spot(this.$.showHideHandle); return true; } } else if (direction == 'LEFT') { this.spotlightLeft(sender, {originator: p}); return true; } },
expandContract: function () { if (this.open) { this.closeDrawerAndHighlightHeader(); } else { this.toggleActive(); if (!Spotlight.getPointerMode() && !Spotlight.isFrozen()) { var first = Spotlight.getFirstChild(this.$.drawer); Spotlight.spot(first); } } },
closeDrawerAndHighlightHeader: function () { var current = Spotlight.getCurrent(); // If the spotlight is elsewhere, we don't want to hijack it (e.g. after the delay in // ExpandablePicker) if (!current || current.isDescendantOf(this)) { if (Spotlight.getPointerMode()) Spotlight.unspot(); else Spotlight.spot(this.$.header); } this.set('active', false); },
finishTransition: function () { var fromIndex = this.fromIndex, toIndex = this.toIndex; this.adjustFirstPanelAfterTransition(); this.notifyPanels('transitionFinished'); Panels.prototype.finishTransition.apply(this, arguments); this.processPanelsToRemove(fromIndex, toIndex); this.processQueuedKey(); Spotlight.unmute(this); Spotlight.spot(this.getActive()); },
drawerOpened: function (rendered) { if (this.resetScroller) { this.$.listActions.scrollTo(0, 0); this.resetScroller = false; } if (this.generated && !rendered) { Spotlight.spot(this.$.closeButton); } this.bubble('onRequestMuteTooltip'); this.doShown(); },
closeDrawerAndHighlightHeader: function () { var current = Spotlight.getPointerMode() ? Spotlight.getLastControl() : Spotlight.getCurrent(); this.removeHistoryEntry(); // If the spotlight is elsewhere, we don't want to hijack it (e.g. after the delay in // ExpandablePicker) if (!current || current.isDescendantOf(this)) { Spotlight.spot(this.$.header); } this.set('active', false); },
controlsOpenChanged: function () { if (this.controlsOpen) { this.doActivate({height: this.controlDrawerHeight}); this.$.controlDrawer.spotlightDisabled = false; Spotlight.spot(this.$.controlDrawer); if (this.allowBackKey) { this.pushBackHistory(); } } else { this.$.controlDrawer.spotlightDisabled = true; this.doDeactivate({height: 0}); } this.animatePosition(); },
scrollToItem: function(index, opts) { var item; if (opts && opts.focus) { opts.behavior = 'instant'; } NewDataList.prototype.scrollToItem.apply(this, arguments); if (opts && opts.focus && !Spotlight.getPointerMode()) { item = this.childForIndex(index); if (item) Spotlight.spot(item); } },
expandContract: function () { if (this.open) { this.closeDrawerAndHighlightHeader(); } else { this.toggleActive(); if (!Spotlight.getPointerMode() && !Spotlight.isFrozen()) { var first = Spotlight.getFirstChild(this.$.drawer); Spotlight.spot(first); } // As we could have entered the expandable when it was closed, we need to explicitly add // the history entry when it is opened. this.addHistoryEntry(); } },
requestSpot: function (inSender, inEvent) { Spotlight.spot(this); return true; }
onSpotlightPanelEnter: function () { if (!this.showing && (this.useHandle === true) && this.handleShowing ) { Spotlight.spot(this.$.showHideHandle); return true; } },
rendered: function () { Control.prototype.rendered.apply(this, arguments); Spotlight.spot(this.$.panels); },
setTimeout(this.bindSafely(function () { Spotlight.spot(this.$.panels); }), 200);
rendered: function () { this.inherited(arguments); Spotlight.spot(this.$.panels); },