diff --git a/docs/app/components/snippets/installation-2.js.txt b/docs/app/components/snippets/installation-2.js.txt new file mode 100644 index 00000000..560a8e0b --- /dev/null +++ b/docs/app/components/snippets/installation-2.js.txt @@ -0,0 +1,13 @@ +import config from './config/environment'; // this line should already be present +import { setConfig } from 'ember-basic-dropdown/config'; + +// Basic usage: +setConfig({ + rootElement: config.APP.rootElement, // Default is 'body' (or '#ember-testing' in tests) +}); + +// Advanced: If you need to override globally the destination element ID (BasicDropdownWormhole), you can do: +setConfig({ + destination: 'my-custom-destination-id', + rootElement: config.APP.rootElement, // Default is 'body' (or '#ember-testing' in tests) +}); diff --git a/docs/app/templates/public-pages/docs/installation.gts b/docs/app/templates/public-pages/docs/installation.gts index 48e1f44f..83a55b49 100644 --- a/docs/app/templates/public-pages/docs/installation.gts +++ b/docs/app/templates/public-pages/docs/installation.gts @@ -5,30 +5,31 @@ import { LinkTo } from '@ember/routing';

Installation

- Ember-basic-dropdown is distributed as an - Ember CLI - addon. To install it, run the following command in your ember project - directory + To install ember-basic-dropdown, run the following command in your ember + project directory

-
$ ember install ember-basic-dropdown
+
$ pnpm install ember-basic-dropdown

- When installing this through - ember install - the addon will add the necessary snippet above automatically in your app. + After the installation you need to add the following lines somewhere in your + app.js/ts.

-

Manual installation

+

- After the installation you need to add the following lines somewhere in your - templates where you want to render the dropdown content into e.g. your - application.hbs. In this component will be rendered the + Then you need to add the following lines somewhere in your templates where + you want to render the dropdown content into e.g. your + application.gjs/gts. In this component will be rendered the dropdown content.

diff --git a/ember-basic-dropdown/README.md b/ember-basic-dropdown/README.md index 620907cd..f7a3aba3 100644 --- a/ember-basic-dropdown/README.md +++ b/ember-basic-dropdown/README.md @@ -31,7 +31,7 @@ It is intended to be a building block for more complex components but is perfect ### Installation ``` -ember install ember-basic-dropdown +pnpm install ember-basic-dropdown ``` For more installation details see [documentation](https://ember-basic-dropdown.com/docs/installation) @@ -111,12 +111,13 @@ If you'd like the dropdown to close itself after a user clicks on it, you can us ```glimmer-ts import BasicDropdown from 'ember-basic-dropdown/components/basic-dropdown'; +import { on } from '@ember/modifier';