Skip to content

Commit

Permalink
Merge pull request #16 from GlenHughes/mode-option
Browse files Browse the repository at this point in the history
Add mode option
  • Loading branch information
vardius authored Dec 21, 2019
2 parents 4f125e4 + e57a218 commit ff5e30d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Is *web-component* library missing something ?

No problem! Simply [fork](https://github.com/vardius/web-component/network#fork-destination-box) this repository, [add middleware](https://github.com/vardius/web-component/wiki/Middleware) and create pull request.

## Instaliation
## Installation

```bash
npm install --save web-component
Expand All @@ -37,7 +37,8 @@ import { WebComponent } from 'web-component'
template: require('./hello-world.html'),// provide template
styles: require('./hello-world.css'), //provide styles
extends: 'button', //default does not extends any
shadowDOM: true //default false
shadowDOM: true, //default false
mode: "open" // default open, set to closed to block access to shadowDOM
})
export class HelloWorld extends HTMLElement {}
```
Expand Down
2 changes: 1 addition & 1 deletion src/connectedCallback/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default options => original => {
let shadowRoot = target.shadowRoot;
if (!shadowRoot) {
shadowRoot = target.attachShadow({
mode: "open"
mode: options.mode ? options.mode : "open"
});
}
target = shadowRoot;
Expand Down

0 comments on commit ff5e30d

Please sign in to comment.