Skip to content
Permalink
Browse files

feat(docs): add vscode docs support (#19309)

  • Loading branch information...
manucorporat committed Sep 9, 2019
1 parent e27962d commit a3f345c06d5d9692481e428be262d70ae9e578da
Showing with 10 additions and 5 deletions.
  1. +1 −1 core/package.json
  2. +4 −4 core/src/utils/watch-options.ts
  3. +5 −0 core/stencil.config.ts
@@ -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",
@@ -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));

@@ -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',

0 comments on commit a3f345c

Please sign in to comment.
You can’t perform that action at this time.