Skip to content

Commit 4550cae

Browse files
committed
do an initial conversion if textarea is not empty
1 parent 6669195 commit 4550cae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

demo/livedemo.opal

+6-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ parse_options.each do |name, value|
118118
case name
119119
when :ruby
120120
$document.querySelector('textarea').value = value
121-
event = `new MouseEvent('click', { bubbles: true, cancelable: true, view: window })`
122-
$document.querySelector('input[type=submit]').dispatchEvent(event)
123121
when :filters
124122
nodes = $document.getElementById(:filters)[:parentNode].querySelectorAll(:input)
125123
nodes.forEach do |node|
@@ -136,3 +134,9 @@ parse_options.each do |name, value|
136134
checkbox.checked = true if checkbox
137135
end
138136
end
137+
138+
# initial conversion if textarea is not empty
139+
unless $document.querySelector('textarea').value.empty?
140+
event = `new MouseEvent('click', { bubbles: true, cancelable: true, view: window })`
141+
$document.querySelector('input[type=submit]').dispatchEvent(event)
142+
end

0 commit comments

Comments
 (0)