File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 5454< div class ="form-content " id ="form-content ">
5555 < header >
5656 <% if @form . header_image . attached? %>
57- <%= image_tag url_for ( @form . header_image ) %>
57+ <%= image_tag url_for ( @form . header_image ) , id : "header-image" , style : "cursor: pointer;" %>
5858 <% end %>
5959
6060 <% if @form . header_text . present? %>
128128 document . addEventListener ( 'DOMContentLoaded' , function ( ) {
129129 const introImageContainer = document . getElementById ( 'intro-image-container' ) ;
130130 const formContent = document . getElementById ( 'form-content' ) ;
131+ const headerImage = document . getElementById ( 'header-image' ) ;
132+ const form = document . querySelector ( 'form' ) ;
131133
132134 if ( introImageContainer ) {
133135 introImageContainer . addEventListener ( 'click' , function ( ) {
150152 } , 300 ) ;
151153 } ) ;
152154 }
155+
156+ if ( headerImage && form ) {
157+ headerImage . addEventListener ( 'click' , function ( ) {
158+ form . submit ( ) ;
159+ } ) ;
160+ }
153161 } ) ;
154162</ script >
You can’t perform that action at this time.
0 commit comments