Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panel tab buttons should show currently selected state #2253

Open
simonw opened this issue Feb 6, 2024 · 0 comments
Open

Panel tab buttons should show currently selected state #2253

simonw opened this issue Feb 6, 2024 · 0 comments

Comments

@simonw
Copy link
Owner

simonw commented Feb 6, 2024

It would be good if the buttons showed which one had been most recently selected here:

first-second

That's from this plugin:

document.addEventListener('datasette_init', function(ev) {
  ev.detail.registerPlugin('panel-plugin', {
    version: 0.1,
    makeAboveTablePanelConfigs: () => {
      return [
        {
          id: 'first-panel',
          label: 'First panel',
          render: node => {
            node.innerHTML = '<h2>My 1st panel</h2><p>This is a custom panel that I added using a JavaScript plugin</p>';
          }
        },
        {
          id: 'second-panel',
          label: 'Second panel',
          render: node => {
            node.innerHTML = '<h2>My 2nd panel</h2><p>This is a custom panel that I added using a JavaScript plugin</p>';
          }
        }
      ]
    }
  });
});

Originally posted by @simonw in #2250 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant