Browse Source

feat(shortcodes): add form attr to button

Josh Habdas 1 year ago
parent
commit
f04ea28b8d
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74
2 changed files with 3 additions and 1 deletions
  1. 1
    0
      layouts/partials/components/button.html
  2. 2
    1
      layouts/shortcodes/hackcss-button.html

+ 1
- 0
layouts/partials/components/button.html View File

@@ -1,6 +1,7 @@
1 1
 <button
2 2
   {{ with .id }}id="{{ . | urlize }}" {{ end }}
3 3
   {{ with .action }}formaction="{{ . | safeURL }}" {{ end }}
4
+  {{ with .form }}form="{{ . }}" {{ end }}
4 5
   {{ with .value }}value="{{ . | safeHTMLAttr }}" {{ end }}
5 6
   {{ with .target }}formtarget="{{ . }}" {{ end }}
6 7
   {{ with .tabindex }}tabindex="{{ . }}" {{ end }}

+ 2
- 1
layouts/shortcodes/hackcss-button.html View File

@@ -35,10 +35,11 @@ Inside a button group:
35 35
 {{ $isblock := .Get "isblock" }}
36 36
 {{ $id := .Get "id" }}
37 37
 {{ $action := .Get "action" }}
38
+{{ $form := .Get "form" }}
38 39
 {{ $value := .Get "value" }}
39 40
 {{ $onclick := .Get "onclick" }}
40 41
 {{ $disabled := .Get "disabled" }}
41 42
 {{ $tabindex := .Get "tabindex" }}
42 43
 {{ $target := .Get "target" }}
43 44
 {{ $method := .Get "method" }}
44
-{{ partial "components/button.html" (dict "type" $type "body" $body "isghost" $isghost "isblock" $isblock "action" $action "value" $value "onclick" $onclick "disabled" $disabled "tabindex" $tabindex "target" $target "method" $method) }}
45
+{{ partial "components/button.html" (dict "type" $type "body" $body "isghost" $isghost "isblock" $isblock "action" $action "form" $form "value" $value "onclick" $onclick "disabled" $disabled "tabindex" $tabindex "target" $target "method" $method) }}

Loading…
Cancel
Save