Browse Source

feat(shortcodes): add form attr to button

pull/130/head
Josh Habdas 2 years ago
parent
commit
f04ea28b8d
Signed by: jhabdas 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 @@
<button
{{ with .id }}id="{{ . | urlize }}" {{ end }}
{{ with .action }}formaction="{{ . | safeURL }}" {{ end }}
{{ with .form }}form="{{ . }}" {{ end }}
{{ with .value }}value="{{ . | safeHTMLAttr }}" {{ end }}
{{ with .target }}formtarget="{{ . }}" {{ end }}
{{ with .tabindex }}tabindex="{{ . }}" {{ end }}

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

@ -35,10 +35,11 @@ Inside a button group:
{{ $isblock := .Get "isblock" }}
{{ $id := .Get "id" }}
{{ $action := .Get "action" }}
{{ $form := .Get "form" }}
{{ $value := .Get "value" }}
{{ $onclick := .Get "onclick" }}
{{ $disabled := .Get "disabled" }}
{{ $tabindex := .Get "tabindex" }}
{{ $target := .Get "target" }}
{{ $method := .Get "method" }}
{{ 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) }}
{{ 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