# Enable NotesPanel after selecting AnnotationCreateSticky Tool

**URL:** <https://pdfjs.community/t/enable-notespanel-after-selecting-annotationcreatesticky-tool/251>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [September 13, 2020, 5:14am UTC](https://pdfjs.community/t/enable-notespanel-after-selecting-annotationcreatesticky-tool/251 "2020-09-13T05:14:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vivek.sonawane](https://avatars.discourse-cdn.com/v4/letter/v/e95f7d/32.png) [@vivek.sonawane](https://pdfjs.community/u/vivek.sonawane)\
**Post date:** [September 13, 2020, 5:14am UTC](https://pdfjs.community/t/enable-notespanel-after-selecting-annotationcreatesticky-tool/251/1 "2020-09-13T05:14:49Z")

</div>

I want to enable NotesPanel after selecting AnnotationCreateSticky Tool.For now whenever I reload webviewer and select Sticky Tool notesPanel doesn’t get enable. When i add one annotation in webviewer only then panel gets enable.  
So, how can i enable it after selecting the tool and also sticky annotation from viewer ?

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [September 15, 2020, 2:14pm UTC](https://pdfjs.community/t/enable-notespanel-after-selecting-annotationcreatesticky-tool/251/2 "2020-09-15T14:14:53Z")

</div>

Hi there,

The following code should do the trick!

```javascript
Webviewer({
...
}, document.getElementById('viewer')).then(instance => {

  const { docViewer, Tools } = instance;
  docViewer.on('toolModeUpdated', (tool) => { 
    if (tool instanceof Tools.StickyCreateTool) {
      instance.openElements(['notesPanel']);
    }
  })
});

```

If you wanted to check on load if the sticky tool is selected you can use [`getToolMode`](https://pdfjs.express/api/CoreControls.DocumentViewer.html#getToolMode__anchor) combined with the logic above.

Thanks!  
Logan
