Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
validator: val => core.isNumber(val) || !core.isDefAndNotNull(val),
value: 30000
maybeParseLastLoadedStateAsJson() {
var state = this.router.lastLoadedState;
try {
return JSON.parse(state);
} catch (err) {
return core.isDefAndNotNull(state) ? state : {};
}
}
handleSurfaceCall_(templateComponentName, templateName, originalFn, data, opt_ignored, opt_ijData) {
data = data || {};
var surfaceData = {
static: originalFn.static,
templateComponentName: templateComponentName,
templateData: data,
templateName: templateName
};
var surfaceElementId;
if (core.isDefAndNotNull(data.surfaceElementId)) {
surfaceElementId = data.surfaceElementId;
} else if (core.isDefAndNotNull(data.surfaceId)) {
surfaceElementId = this.getSurfaceElementId(data.surfaceId.toString());
} else {
if (originalFn.private) {
return originalFn.call(null, data, opt_ignored, opt_ijData);
}
surfaceElementId = this.generateSurfaceElementId(this.surfaceBeingRendered_, surfaceData);
}
return this.buildPlaceholder(surfaceElementId, surfaceData);
}
this.closedWithKeyboard_ = true;
this.expanded_ = false;
break;
case 38:
this.focusedIndex_ = core.isDefAndNotNull(this.focusedIndex_)
? this.focusedIndex_
: 1;
this.focusIndex_(
this.focusedIndex_ === 0
? this.items.length - 1
: this.focusedIndex_ - 1
);
event.preventDefault();
break;
case 40:
this.focusedIndex_ = core.isDefAndNotNull(this.focusedIndex_)
? this.focusedIndex_
: -1;
this.focusIndex_(
this.focusedIndex_ === this.items.length - 1
? 0
: this.focusedIndex_ + 1
);
event.preventDefault();
break;
}
} else if (
(keyCode === 13 || keyCode === 32) &&
dom.hasClass(event.target, 'dropdown-select')
) {
this.openedWithKeyboard_ = true;
this.expanded_ = true;
load(path) {
var cache = this.getCache();
if (core.isDefAndNotNull(cache)) {
return CancellablePromise.resolve(cache);
}
var body = null;
var httpMethod = this.httpMethod;
var headers = new MultiMap();
Object.keys(this.httpHeaders).forEach(header => headers.add(header, this.httpHeaders[header]));
if (globals.capturedFormElement) {
body = new FormData(globals.capturedFormElement);
httpMethod = RequestScreen.POST;
if (UA.isIeOrEdge) {
headers.add('If-None-Match', '"0"');
}
}
createPlaceholderSurface_(parentSurfaceElementId, opt_surfaceElementId) {
var surfaceElementId = opt_surfaceElementId;
if (!core.isDefAndNotNull(surfaceElementId)) {
surfaceElementId = this.generateSurfaceElementId(parentSurfaceElementId);
}
var surface = this.getSurfaceFromElementId(surfaceElementId);
if (!surface) {
surface = {
surfaceElementId: surfaceElementId
};
this.addSurface(surfaceElementId, surface);
}
return surface;
}
handleSurfaceCall_(templateComponentName, templateName, originalFn, data, opt_ignored, opt_ijData) {
data = data || {};
var surfaceData = {
static: originalFn.static,
templateComponentName: templateComponentName,
templateData: data,
templateName: templateName
};
var surfaceElementId;
if (core.isDefAndNotNull(data.surfaceElementId)) {
surfaceElementId = data.surfaceElementId;
} else if (core.isDefAndNotNull(data.surfaceId)) {
surfaceElementId = this.getSurfaceElementId(data.surfaceId.toString());
} else {
if (originalFn.private) {
return originalFn.call(null, data, opt_ignored, opt_ijData);
}
surfaceElementId = this.generateSurfaceElementId(this.surfaceBeingRendered_, surfaceData);
}
return this.buildPlaceholder(surfaceElementId, surfaceData);
}