Skip to content

Commit

Permalink
feat(docs): add vscode docs support (#19309)
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Sep 9, 2019
1 parent e27962d commit a3f345c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/package.json
Expand Up @@ -34,7 +34,7 @@
"tslib": "^1.10.0"
},
"devDependencies": {
"@stencil/core": "1.3.2",
"@stencil/core": "1.4.0",
"@stencil/sass": "1.0.1",
"@types/jest": "24.0.17",
"@types/node": "12.7.1",
Expand Down
8 changes: 4 additions & 4 deletions core/src/utils/watch-options.ts
Expand Up @@ -9,22 +9,22 @@ export const watchForOptions = <T extends HTMLElement>(containerEl: HTMLElement,
return mutation;
};

const getSelectedOption = <T extends HTMLElement>(mutationList: MutationRecord[], tagName: string) => {
let newOption: T | undefined;
const getSelectedOption = <T extends HTMLElement>(mutationList: MutationRecord[], tagName: string): T | undefined => {
let newOption: HTMLElement | undefined;
mutationList.forEach(mut => {
// tslint:disable-next-line: prefer-for-of
for (let i = 0; i < mut.addedNodes.length; i++) {
newOption = findCheckedOption(mut.addedNodes[i], tagName) || newOption;
}
});
return newOption;
return newOption as any;
};

export const findCheckedOption = (el: any, tagName: string) => {
if (el.nodeType !== 1) {
return undefined;
}
const options = (el.tagName === tagName.toUpperCase())
const options: HTMLElement[] = (el.tagName === tagName.toUpperCase())
? [el]
: Array.from(el.querySelectorAll(tagName));

Expand Down
5 changes: 5 additions & 0 deletions core/stencil.config.ts
Expand Up @@ -69,6 +69,11 @@ export const config: Config = {
})
],
outputTargets: [
{
type: 'docs-vscode',
file: 'dist/html.html-data.json',
sourceCodeBaseUrl: 'https://github.com/ionic-team/ionic/tree/master/core/',
},
{
type: 'dist',
esmLoaderPath: '../loader',
Expand Down

0 comments on commit a3f345c

Please sign in to comment.