-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #586 from Badgerati/fix_modal_txtbox
Fixes a bug preventing textboxes in Modals from working; Fixes a bug preventing URL Buttons from working
- Loading branch information
Showing
6 changed files
with
102 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Import-Module Pode -MaximumVersion 2.99.99 -Force | ||
Import-Module ..\src\Pode.Web.psm1 -Force | ||
|
||
Start-PodeServer -Browse { | ||
# add a simple endpoint | ||
Add-PodeEndpoint -Address localhost -Port 8090 -Protocol Http | ||
New-PodeLoggingMethod -Terminal | Enable-PodeErrorLogging | ||
|
||
# set the use of templates, and set a login page | ||
Use-PodeWebTemplates -Title 'Modals Example' -Theme Dark | ||
|
||
# home page with link togglging | ||
Add-PodeWebPage -Name 'Home' -Path '/' -HomePage -Title 'Homepage' -ScriptBlock { | ||
# modal 1 - form | ||
New-PodeWebModal -Name 'Form Modal' -AsForm -Content @( | ||
New-PodeWebTextbox -Name 'Name1' -Type Text | ||
New-PodeWebTextbox -Name 'Comment1' -Multiline | ||
) -ScriptBlock { | ||
Show-PodeWebToast -Title $WebEvent.Data.Name1 -Message $WebEvent.Data.Comment1 | ||
Hide-PodeWebModal | ||
} | ||
|
||
# modal 2 - no form | ||
New-PodeWebModal -Name 'Normal Modal' -Content @( | ||
New-PodeWebTextbox -Name 'Name2' -Type Text | ||
New-PodeWebTextbox -Name 'Comment2' -Multiline | ||
) -ScriptBlock { | ||
Show-PodeWebToast -Title $WebEvent.Data.Name2 -Message $WebEvent.Data.Comment2 | ||
Hide-PodeWebModal | ||
} | ||
|
||
# buttons to show modals | ||
New-PodeWebCard -Name 'Show Modals' -Content @( | ||
New-PodeWebButtonGroup -Buttons @( | ||
New-PodeWebButton -Name 'Show Form Modal' -ScriptBlock { | ||
Show-PodeWebModal -Name 'Form Modal' | ||
} | ||
New-PodeWebButton -Name 'Show Normal Modal' -ScriptBlock { | ||
Show-PodeWebModal -Name 'Normal Modal' | ||
} | ||
) | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters