Example #1
0
	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;
				}
			}
		}
	},
Example #2
0
	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;
			}
		}
	},
Example #3
0
	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);
		}
	},
Example #4
0
	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;
    },
Example #6
0
	rightHandler: function(sender, event) {
		var panels = this.owner;
		if (this.index+1 ==	panels.index) {
			Spotlight.spot(panels.getActive());
			return true;
		}
	}
Example #7
0
	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;
		}
	},
Example #8
0
	drawerClosed: function (rendered) {
		if (this.generated && !rendered) {
			Spotlight.spot(this.$.activator);
		}
		this.bubble('onRequestUnmuteTooltip');

		if (!rendered) this.doHidden();
	},
Example #9
0
	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;
		}
	},
Example #10
0
	handleSpotLeft: function () {
		if (this.showing) {
			Spotlight.spot(this.getActive());
		} else {
			Spotlight.unspot();
		}
		return true;
	},
Example #11
0
		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();
				}
			} 
		},
Example #12
0
 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;
     }
 }
Example #13
0
	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;
		}
	},
Example #14
0
	expandContract: function () {
		if (this.open) {
			this.closeDrawerAndHighlightHeader();
		} else {
			this.toggleActive();
			if (!Spotlight.getPointerMode() && !Spotlight.isFrozen()) {
				var first = Spotlight.getFirstChild(this.$.drawer);
				Spotlight.spot(first);
			}
		}
	},
Example #15
0
	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);
	},
Example #16
0
	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());
	},
Example #17
0
	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);
	},
Example #19
0
	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();
	},
Example #20
0
	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;
	}
Example #23
0
	onSpotlightPanelEnter: function () {
		if (!this.showing && (this.useHandle === true) && this.handleShowing ) {
			Spotlight.spot(this.$.showHideHandle);
			return true;
		}
	},
Example #24
0
	rendered: function () {
		Control.prototype.rendered.apply(this, arguments);
		Spotlight.spot(this.$.panels);
	},
Example #25
0
		setTimeout(this.bindSafely(function () {
			Spotlight.spot(this.$.panels);
		}), 200);
	rendered: function () {
		this.inherited(arguments);
		Spotlight.spot(this.$.panels);
	},