File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -162,4 +162,49 @@ summary.querySelector('form').summary.oninput = function() {
162162
163163 summary . querySelector ( 'form > div > label > small' ) . innerHTML = this . value . length + ' / ' + this . maxLength + '<sub>50 - ' + ( 50 - this . maxLength ) + '</sub>' ;
164164
165+ } ;
166+ summary . querySelector ( 'form' ) . onsubmit = function ( e ) { e . preventDefault ( ) ;
167+
168+ if ( e . submitter . classList . contains ( 'finish' ) ) {
169+
170+ significantChange . querySelector ( 'form' ) . significantChange . parentNode . click ( ) ;
171+ significantChange . querySelector ( 'form' ) . significantChange . checked = false ;
172+
173+ currentTarget = significantChange ;
174+ significantChange . scrollIntoView ( {
175+ behavior : 'smooth'
176+ } ) ;
177+
178+ } else {
179+
180+ body . querySelector ( 'form' ) . body . parentNode . click ( ) ;
181+
182+ currentTarget = body ;
183+ body . scrollIntoView ( {
184+ behavior : 'smooth'
185+ } ) ;
186+
187+ }
188+
189+ } ;
190+ summary . querySelector ( 'form' ) . onreset = function ( ) {
191+
192+ if ( type . querySelector ( 'form' ) . type . value == 'revert' ) {
193+
194+ currentTarget = type ;
195+ type . scrollIntoView ( {
196+ behavior : 'smooth'
197+ } ) ;
198+
199+ } else {
200+
201+ scope . querySelector ( 'form' ) . scope . parentNode . click ( ) ;
202+
203+ currentTarget = scope ;
204+ scope . scrollIntoView ( {
205+ behavior : 'smooth'
206+ } ) ;
207+
208+ }
209+
165210} ;
You can’t perform that action at this time.
0 commit comments