Skip to content

Commit 7fff139

Browse files
authored
fix: invalid method
1 parent 2baae70 commit 7fff139

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/editor-components/page.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ const myPage = page('My Plugin Page', {
4242
| `on(event, callback)` | Adds an event listener to the page |
4343
| `off(event, callback)` | Removes an event listener from the page |
4444
| `setTitle(title)` | Updates the page title |
45-
| `show()` | Makes the page visible |
4645
| `hide()` | Hides the page |
4746

4847
## Properties
@@ -55,6 +54,10 @@ const myPage = page('My Plugin Page', {
5554
| `textContent` | string | The page's text content |
5655
| `lead` | HTMLElement | The lead element if defined |
5756

57+
:::info
58+
You'll need to implement `show` method according to your situation at your own.
59+
:::
60+
5861
## Example
5962

6063
Here's a complete example of creating a settings page for a plugin:
@@ -69,7 +72,7 @@ function createSettingsPage() {
6972

7073
const saveButton = tag('span', {
7174
className: 'icon save',
72-
onclick: saveSettings
75+
onclick: () => {console.log("save settings")}
7376
});
7477

7578
// Initialize page
@@ -87,6 +90,15 @@ function createSettingsPage() {
8790

8891
form.append(input);
8992
settingsPage.appendBody(form);
93+
settingsPage.show = () => {
94+
// to have proper behaviour for mobile back button press, check actionStack doc for more
95+
const actionStack = acode.require("actionStack");
96+
actionStack.push({
97+
id: "some_id",
98+
action: settingsPage.hide,
99+
});
100+
app.append(settingsPage);
101+
};
90102

91103
// Show the page
92104
settingsPage.show();

0 commit comments

Comments
 (0)