Skip to content

Commit

Permalink
doc: update plugin creation guide
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Dec 20, 2021
1 parent 1d52863 commit fcb5a4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/plugins/writing-a-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ If your plugin requires custom CSS, import the stylesheet directly in your main
require('rollup-plugin-postcss')({
extract : true,
sourceMap: true,
use : ['sass'],
plugins : [
require('@csstools/postcss-sass')({}),
require('autoprefixer')({}),
],
})
Expand All @@ -117,8 +117,8 @@ Photo Sphere Viewer buttons **must** extend `AbstractButton`, check the <ApiLink
- It **can** implement the `isSupported` method to inform the viewer if the action is possible depending on the environement.
- It **can** provide additional parameters to `super` :
- 2nd: a CSS class name applied to the button
- 3rd: a boolean indicating the button can be collapsed in the menu on small screens
- 4th: a boolean indicating the button can be activated with the keyboard
- 3rd: a boolean indicating the button can be collapsed in the menu on small screens (default `false`)
- 4th: a boolean indicating the button can be activated with the keyboard (default `true`)

```js
import { AbstractButton } from 'photo-sphere-viewer';
Expand All @@ -129,7 +129,7 @@ export class CustomButton extends AbstractButton {
static icon = customIcon;

constructor(navbar) {
super(navbar, 'custom-button-class', true);
super(navbar, 'custom-button-class', true, true);

// do your initialisation logic here
// you will probably need the instance of your plugin
Expand Down

0 comments on commit fcb5a4f

Please sign in to comment.