Skip to content

Commit 73db35d

Browse files
committed
Removing auto "summary" page setup when AMF changed per DC use case
1 parent 597f0b7 commit 73db35d

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

api-console.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,7 @@ <h1 class="method-title">[[methodName]]</h1>
338338
*
339339
* @type {Object|Array}
340340
*/
341-
amfModel: {
342-
type: Object,
343-
observer: '_amfModelChanged'
344-
},
341+
amfModel: Object,
345342
/**
346343
* It is current selection from the navigation represented
347344
* as an `@id` property of the AMD json/ld model.
@@ -752,10 +749,12 @@ <h1 class="method-title">[[methodName]]</h1>
752749
this.page = 'request';
753750
}
754751
/**
755-
* Handler for the `amfModel` property change.
756-
* Sets the `path` to summary.
752+
* Resets current selection to "summary" page
757753
*/
758-
_amfModelChanged() {
754+
resetSelection() {
755+
if (this.page !== 'docs') {
756+
this.page = 'docs';
757+
}
759758
this.selectedShapeType = 'summary';
760759
this.selectedShape = 'summary';
761760
}

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"Pawel Psztyc",
66
"The Advanced REST client authors <[email protected]>"
77
],
8-
"version": "5.0.0-preview",
8+
"version": "5.0.0-preview-1",
99
"keywords": [
1010
"web-components",
1111
"polymer",

demo/standalone/app.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
apiconsole.app.observeRouteEvents();
3636
apiconsole.app.observeConsoleControls();
3737
apiconsole.app.observeAmfParser();
38-
let dataElement = document.querySelector('parser-element');
38+
const dataElement = document.querySelector('parser-element');
3939
dataElement.removeAttribute('hidden');
4040
};
4141
/**
@@ -106,7 +106,9 @@
106106
e.target.setAttribute('hidden', true);
107107
let apic = document.querySelector('api-console');
108108
apic.removeAttribute('hidden');
109-
109+
if (apic.resetSelection) {
110+
apic.resetSelection();
111+
}
110112
requestAnimationFrame(() => {
111113
apic.resetLayout();
112114
if (apiconsole.app.__initialType && apiconsole.app.__initialSelected) {

0 commit comments

Comments
 (0)