Skip to content

Commit 3ab93e0

Browse files
authored
Update installation docs and minor fixes in readme (#1021)
1 parent 187002d commit 3ab93e0

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import config from './config/environment'; // this line should already be present
2+
import { setConfig } from 'ember-basic-dropdown/config';
3+
4+
// Basic usage:
5+
setConfig({
6+
rootElement: config.APP.rootElement, // Default is 'body' (or '#ember-testing' in tests)
7+
});
8+
9+
// Advanced: If you need to override globally the destination element ID (BasicDropdownWormhole), you can do:
10+
setConfig({
11+
destination: 'my-custom-destination-id',
12+
rootElement: config.APP.rootElement, // Default is 'body' (or '#ember-testing' in tests)
13+
});

docs/app/templates/public-pages/docs/installation.gts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,31 @@ import { LinkTo } from '@ember/routing';
55
<h1 class="doc-page-title">Installation</h1>
66

77
<p>
8-
Ember-basic-dropdown is distributed as an
9-
<a href="https://www.ember-cli.com/">Ember CLI</a>
10-
addon. To install it, run the following command in your ember project
11-
directory
8+
To install ember-basic-dropdown, run the following command in your ember
9+
project directory
1210
</p>
1311

1412
<p>
1513
<div class="code-block">
16-
<pre>$ ember install ember-basic-dropdown</pre>
14+
<pre>$ pnpm install ember-basic-dropdown</pre>
1715
</div>
1816
</p>
1917

2018
<p>
21-
When installing this through
22-
<code>ember install</code>
23-
the addon will add the necessary snippet above automatically in your app.
19+
After the installation you need to add the following lines somewhere in your
20+
<code>app.js/ts</code>.
2421
</p>
2522

26-
<h3>Manual installation</h3>
23+
<CodeExample
24+
@js="installation-2.js.txt"
25+
@showResult={{false}}
26+
@activeTab="js"
27+
/>
2728

2829
<p>
29-
After the installation you need to add the following lines somewhere in your
30-
templates where you want to render the dropdown content into e.g. your
31-
<code>application.hbs</code>. In this component will be rendered the
30+
Then you need to add the following lines somewhere in your templates where
31+
you want to render the dropdown content into e.g. your
32+
<code>application.gjs/gts</code>. In this component will be rendered the
3233
dropdown content.
3334
</p>
3435

ember-basic-dropdown/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ It is intended to be a building block for more complex components but is perfect
3131
### Installation
3232

3333
```
34-
ember install ember-basic-dropdown
34+
pnpm install ember-basic-dropdown
3535
```
3636

3737
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
111111

112112
```glimmer-ts
113113
import BasicDropdown from 'ember-basic-dropdown/components/basic-dropdown';
114+
import { on } from '@ember/modifier';
114115
115116
<template>
116117
<BasicDropdown as |dd|>
117118
<dd.Trigger>Click me!</dd.Trigger>
118119
<dd.Content>
119-
<div {{action dd.actions.close}}>
120+
<div role="button" {{on "click" dd.actions.close}}>
120121
{{yield dd}}
121122
</div>
122123
</dd.Content>

0 commit comments

Comments
 (0)