glimmer-dsl-opal 0.9.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +366 -161
  5. data/VERSION +1 -1
  6. data/lib/display.rb +1 -1
  7. data/lib/glimmer-dsl-opal.rb +8 -4
  8. data/lib/glimmer-dsl-opal/ext/file.rb +1 -1
  9. data/lib/glimmer-dsl-opal/ext/glimmer/dsl/engine.rb +28 -8
  10. data/lib/glimmer-dsl-opal/samples/elaborate/contact_manager/contact_repository.rb +4 -4
  11. data/lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe.rb +2 -2
  12. data/lib/glimmer-dsl-opal/samples/hello/hello_browser.rb +1 -1
  13. data/lib/glimmer-dsl-opal/samples/hello/hello_button.rb +1 -1
  14. data/lib/glimmer-dsl-opal/samples/hello/hello_checkbox.rb +1 -1
  15. data/lib/glimmer-dsl-opal/samples/hello/hello_checkbox_group.rb +1 -1
  16. data/lib/glimmer-dsl-opal/samples/hello/hello_combo.rb +1 -1
  17. data/lib/glimmer-dsl-opal/samples/hello/hello_computed.rb +1 -1
  18. data/lib/glimmer-dsl-opal/samples/hello/hello_computed/contact.rb +21 -0
  19. data/lib/glimmer-dsl-opal/samples/hello/hello_custom_shell.rb +1 -1
  20. data/lib/glimmer-dsl-opal/samples/hello/hello_custom_widget.rb +1 -1
  21. data/lib/glimmer-dsl-opal/samples/hello/hello_date_time.rb +1 -1
  22. data/lib/glimmer-dsl-opal/samples/hello/hello_dialog.rb +78 -0
  23. data/lib/glimmer-dsl-opal/samples/hello/hello_group.rb +1 -1
  24. data/lib/glimmer-dsl-opal/samples/hello/hello_list_multi_selection.rb +1 -1
  25. data/lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb +1 -1
  26. data/lib/glimmer-dsl-opal/samples/hello/hello_menu_bar.rb +1 -1
  27. data/lib/glimmer-dsl-opal/samples/hello/hello_message_box.rb +1 -1
  28. data/lib/glimmer-dsl-opal/samples/hello/hello_pop_up_context_menu.rb +1 -1
  29. data/lib/glimmer-dsl-opal/samples/hello/hello_radio.rb +1 -1
  30. data/lib/glimmer-dsl-opal/samples/hello/hello_radio_group.rb +1 -1
  31. data/lib/glimmer-dsl-opal/samples/hello/hello_tab.rb +1 -1
  32. data/lib/glimmer-dsl-opal/samples/hello/hello_table.rb +1 -1
  33. data/lib/glimmer-dsl-opal/samples/hello/hello_world.rb +4 -4
  34. data/lib/glimmer-dsl-swt.rb +1 -1
  35. data/lib/glimmer/config/opal_logger.rb +16 -0
  36. data/lib/glimmer/dsl/opal/async_exec_expression.rb +1 -1
  37. data/lib/glimmer/dsl/opal/block_property_expression.rb +1 -1
  38. data/lib/glimmer/dsl/opal/checkbox_group_selection_data_binding_expression.rb +1 -1
  39. data/lib/glimmer/dsl/opal/color_expression.rb +1 -1
  40. data/lib/glimmer/dsl/opal/custom_widget_expression.rb +1 -1
  41. data/lib/glimmer/dsl/opal/dialog_expression.rb +20 -0
  42. data/lib/glimmer/dsl/opal/display_expression.rb +1 -1
  43. data/lib/glimmer/dsl/opal/dsl.rb +1 -1
  44. data/lib/glimmer/dsl/opal/exec_expression.rb +1 -1
  45. data/lib/glimmer/dsl/opal/font_expression.rb +1 -1
  46. data/lib/glimmer/dsl/opal/menu_bar_expression.rb +1 -1
  47. data/lib/glimmer/dsl/opal/menu_expression.rb +1 -1
  48. data/lib/glimmer/dsl/opal/message_box_expression.rb +1 -1
  49. data/lib/glimmer/dsl/opal/radio_group_selection_data_binding_expression.rb +1 -1
  50. data/lib/glimmer/dsl/opal/rgb_expression.rb +1 -1
  51. data/lib/glimmer/dsl/opal/rgba_expression.rb +1 -1
  52. data/lib/glimmer/dsl/opal/swt_expression.rb +4 -4
  53. data/lib/glimmer/dsl/opal/sync_exec_expression.rb +1 -1
  54. data/lib/glimmer/swt.rb +1 -1
  55. data/lib/glimmer/swt/color_proxy.rb +1 -1
  56. data/lib/glimmer/swt/composite_proxy.rb +16 -2
  57. data/lib/glimmer/swt/control_editor.rb +1 -1
  58. data/lib/glimmer/swt/custom/checkbox_group.rb +1 -1
  59. data/lib/glimmer/swt/custom/radio_group.rb +1 -1
  60. data/lib/glimmer/swt/dialog_proxy.rb +191 -0
  61. data/lib/glimmer/swt/display_proxy.rb +34 -5
  62. data/lib/glimmer/swt/font_proxy.rb +1 -1
  63. data/lib/glimmer/swt/grid_layout_proxy.rb +11 -16
  64. data/lib/glimmer/swt/label_proxy.rb +22 -1
  65. data/lib/{glimmer-dsl-opal/ext/struct.rb → glimmer/swt/latest_dialog_proxy.rb} +19 -12
  66. data/lib/glimmer/swt/latest_message_box_proxy.rb +25 -1
  67. data/lib/glimmer/swt/latest_shell_proxy.rb +59 -0
  68. data/lib/glimmer/swt/layout_data_proxy.rb +4 -0
  69. data/lib/glimmer/swt/layout_proxy.rb +9 -6
  70. data/lib/glimmer/swt/make_shift_shell_proxy.rb +1 -1
  71. data/lib/glimmer/swt/menu_item_proxy.rb +1 -1
  72. data/lib/glimmer/swt/menu_proxy.rb +3 -3
  73. data/lib/glimmer/swt/message_box_proxy.rb +45 -16
  74. data/lib/glimmer/swt/row_layout_proxy.rb +24 -6
  75. data/lib/glimmer/swt/shell_proxy.rb +43 -9
  76. data/lib/glimmer/swt/style_constantizable.rb +1 -1
  77. data/lib/glimmer/swt/swt_proxy.rb +1 -1
  78. data/lib/glimmer/swt/tab_folder_proxy.rb +1 -1
  79. data/lib/glimmer/swt/table_editor.rb +1 -1
  80. data/lib/glimmer/swt/table_item_proxy.rb +1 -1
  81. data/lib/glimmer/swt/table_proxy.rb +1 -1
  82. data/lib/glimmer/swt/widget_proxy.rb +50 -17
  83. data/lib/glimmer/ui/custom_shell.rb +1 -1
  84. data/lib/glimmer/ui/custom_widget.rb +1 -1
  85. data/lib/glimmer/util/proc_tracker.rb +15 -6
  86. data/lib/net/http.rb +30 -2
  87. data/lib/os.rb +1 -1
  88. metadata +30 -5
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -0,0 +1,20 @@
1
+ require 'glimmer/dsl/static_expression'
2
+ require 'glimmer/dsl/top_level_expression'
3
+ require 'glimmer/dsl/parent_expression'
4
+ require 'glimmer/swt/dialog_proxy'
5
+
6
+ module Glimmer
7
+ module DSL
8
+ module Opal
9
+ class DialogExpression < StaticExpression
10
+ include TopLevelExpression
11
+ include ParentExpression
12
+
13
+ def interpret(parent, keyword, *args, &block)
14
+ parent = args.delete_at(0)
15
+ Glimmer::SWT::DialogProxy.new(parent, args)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -27,7 +27,7 @@ require 'glimmer/dsl/opal/radio_group_selection_data_binding_expression'
27
27
  require 'glimmer/dsl/opal/checkbox_group_selection_data_binding_expression'
28
28
  require 'glimmer/dsl/opal/block_property_expression'
29
29
  require 'glimmer/dsl/opal/menu_expression'
30
- # require 'glimmer/dsl/opal/menu_bar_expression'
30
+ require 'glimmer/dsl/opal/dialog_expression'
31
31
 
32
32
  module Glimmer
33
33
  module DSL
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -11,7 +11,7 @@ module Glimmer
11
11
  include ParentExpression
12
12
 
13
13
  def interpret(parent, keyword, *args, &block)
14
- parent = args.delete_at(0)
14
+ parent = args.delete_at(0) if !textual?(args.first)
15
15
  Glimmer::SWT::MessageBoxProxy.new(parent, args)
16
16
  end
17
17
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
1
- # Copyright (c) 2007-2020 Andy Maleh
2
- #
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -4,8 +4,6 @@ require 'glimmer/swt/widget_proxy'
4
4
  module Glimmer
5
5
  module SWT
6
6
  class CompositeProxy < WidgetProxy
7
- attr_reader :layout
8
-
9
7
  def initialize(parent, args, block)
10
8
  super(parent, args, block)
11
9
  @layout = default_layout
@@ -27,7 +25,23 @@ module Glimmer
27
25
  def layout=(the_layout)
28
26
  @layout = the_layout
29
27
  end
28
+ alias set_layout layout=
29
+ alias setLayout layout=
30
+
31
+ def get_layout
32
+ @layout
33
+ end
34
+ alias getLayout get_layout #TODO consider pregenerating these aliases with an easy method in the future
35
+
36
+ def pack(*args)
37
+ # No Op (just a shim) TODO consider if it should be implemented
38
+ end
30
39
 
40
+ def layout​(changed = nil, all = nil)
41
+ # TODO implement layout(changed = nil, all = nil) just as per SWT API
42
+ @layout&.layout(self, changed)
43
+ end
44
+
31
45
  end
32
46
 
33
47
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Andy Maleh
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -0,0 +1,191 @@
1
+ # Copyright (c) 2020-2021 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ require 'glimmer/swt/widget_proxy'
23
+ require 'glimmer/swt/display_proxy'
24
+
25
+ module Glimmer
26
+ module SWT
27
+ class DialogProxy < CompositeProxy
28
+ STYLE = <<~CSS
29
+ .ui-dialog .ui-dialog-content {
30
+ background: rgb(235, 235, 235);
31
+ }
32
+ .ui-dialog-titlebar {
33
+ background: rgb(80, 116, 211);
34
+ color: white;
35
+ }
36
+ .ui-dialog .dialog .ui-widget-overlay {
37
+ z-index: 10 !important;
38
+ background-color: rgba(0, 0, 0, 0.4);
39
+ opacity: 1;
40
+ }
41
+ .ui-dialog * {
42
+ z-index: 200 !important;
43
+ }
44
+ CSS
45
+
46
+
47
+ # .close {
48
+ # color: #aaaaaa;
49
+ # float: right;
50
+ # font-weight: bold;
51
+ # margin: 5px;
52
+ # }
53
+ # .close:hover,
54
+ # .close:focus {
55
+ # color: #000;
56
+ # text-decoration: none;
57
+ # cursor: pointer;
58
+ # }
59
+
60
+ attr_reader :text
61
+
62
+ def initialize(parent, args, block)
63
+ i = 0
64
+ @parent = parent
65
+ @parent = nil if parent.is_a?(LatestShellProxy)
66
+ @parent ||= DisplayProxy.instance.shells.detect(&:open?) || ShellProxy.new([])
67
+ @args = args
68
+ @block = block
69
+ @children = Set.new
70
+ @enabled = true
71
+ # on_widget_selected {
72
+ # hide
73
+ # }
74
+ DisplayProxy.instance.opened_dialogs.last&.suspend_event_handling
75
+ DisplayProxy.instance.dialogs << self
76
+ @parent.post_initialize_child(self)
77
+ end
78
+
79
+ def text=(txt)
80
+ @text = txt
81
+ if @init
82
+ dom_element.dialog('option', 'title', @text)
83
+ else
84
+ dom_element.attr('title', @text)
85
+ end
86
+ end
87
+
88
+ def open?
89
+ @open
90
+ end
91
+
92
+ def open
93
+ owned_proc = Glimmer::Util::ProcTracker.new(owner: self) {
94
+ shell.open(async: false) unless shell.open?
95
+ unless @init
96
+ dom_element.remove_class('hide')
97
+ dom_element.dialog('auto_open' => false)
98
+ @init = true
99
+ dom_element.dialog('option', 'appendTo', parent.path)
100
+ dom_element.dialog('option', 'modal', true) # NOTE: Not Working! Doing manually below by relying on overlay in ShellProxy.
101
+ unless DisplayProxy.instance.dialogs.any?(&:open?) # only add for first dialog open
102
+ Element['.dialog-overlay'].remove_class('hide')
103
+ end
104
+ dom_element.dialog('option', 'closeOnEscape', true)
105
+ dom_element.dialog('option', 'draggable', true)
106
+ dom_element.dialog('option', 'width', 'auto')
107
+ dom_element.dialog('option', 'minHeight', 'none')
108
+ dom_element.on('dialogclose') do
109
+ unless @hiding
110
+ close
111
+ else
112
+ @hiding = false
113
+ end
114
+ end
115
+ else
116
+ dom_element.dialog('open')
117
+ end
118
+ @open = true
119
+ }
120
+ DisplayProxy.instance.async_exec(owned_proc)
121
+ end
122
+
123
+ def hide
124
+ @hiding = true
125
+ dom_element.dialog('close')
126
+ @open = false
127
+ Element['.dialog-overlay'].add_class('hide') unless DisplayProxy.instance.dialogs.any?(&:open?)
128
+ end
129
+
130
+ def close
131
+ dom_element.dialog('destroy')
132
+ dom_element.remove
133
+ @open = false
134
+ @init = false
135
+ Element['.dialog-overlay'].add_class('hide') unless DisplayProxy.instance.dialogs.any?(&:open?)
136
+ parent.children.delete(self)
137
+ shell.close if shell.children.empty?
138
+ DisplayProxy.instance.dialogs.delete(self)
139
+ DisplayProxy.instance.opened_dialogs.last&.resume_event_handling
140
+ end
141
+
142
+
143
+ def content(&block)
144
+ Glimmer::DSL::Engine.add_content(self, Glimmer::DSL::Opal::DialogExpression.new, &block)
145
+ end
146
+
147
+ def path
148
+ if @init # it gets moved once initialized by jQuery UI, so only ID is reliable then
149
+ "##{id}"
150
+ else
151
+ super
152
+ end
153
+ end
154
+
155
+ def suspend_event_handling
156
+ super
157
+ Element["[aria-describedby=#{id}]"].css('z-index', 9)
158
+ end
159
+
160
+ def resume_event_handling
161
+ super
162
+ Element["[aria-describedby=#{id}]"].css('z-index', 100)
163
+ end
164
+
165
+ # def selector
166
+ # super + ' .close'
167
+ # end
168
+ #
169
+ # def listener_path
170
+ # widget_path + ' .close'
171
+ # end
172
+ #
173
+ # def observation_request_to_event_mapping
174
+ # {
175
+ # 'on_widget_selected' => {
176
+ # event: 'click'
177
+ # },
178
+ # }
179
+ # end
180
+
181
+ def dom
182
+ @dom ||= html {
183
+ div(id: id, class: "#{name} modal hide", title: text) {
184
+ }
185
+ }.to_s
186
+ end
187
+ end
188
+ end
189
+ end
190
+
191
+ require 'glimmer/dsl/opal/dialog_expression'
@@ -1,3 +1,5 @@
1
+ require 'glimmer/swt/widget_proxy'
2
+
1
3
  module Glimmer
2
4
  module SWT
3
5
  class DisplayProxy < WidgetProxy
@@ -32,20 +34,47 @@ module Glimmer
32
34
  @message_boxes ||= []
33
35
  end
34
36
 
37
+ def dialogs
38
+ @dialogs ||= []
39
+ end
40
+
41
+ def modals
42
+ message_boxes + dialogs
43
+ end
44
+
45
+ def message_box_open?
46
+ message_boxes.any?(&:open?)
47
+ end
48
+
49
+ def dialog_open?
50
+ dialogs.any?(&:open?)
51
+ end
52
+
53
+ def opened_dialogs
54
+ dialogs.select(&:open?)
55
+ end
56
+
57
+ def modal_open?
58
+ message_box_open? or dialog_open?
59
+ end
60
+
35
61
  def render
36
62
  # No rendering as body is rendered as part of ShellProxy.. this class only serves as an SWT Display utility
37
63
  end
38
64
 
39
- def async_exec(&block)
65
+ def async_exec(proc_tracker = nil, &block)
66
+ block = proc_tracker unless proc_tracker.nil?
67
+ can_open_modal = !modal_open?
68
+ return block.call if !can_open_modal && dialog_open? && block.respond_to?(:owner) && !block.owner.nil? && block.owner.is_a?(DialogProxy) && opened_dialogs.last == WidgetProxy.widget_handling_listener&.dialog_ancestor
69
+ return block.call if !can_open_modal && block.respond_to?(:owner) && !block.owner.nil? && block.owner.is_a?(MessageBoxProxy)
40
70
  executer = lambda do
41
- if Document.find('.modal').to_a.empty?
71
+ if !modal_open?
42
72
  block.call
43
73
  else
44
- sleep(0.05)
45
- Async::Task.new(&executer)
74
+ Async::Task.new(delay: 100, &executer)
46
75
  end
47
76
  end
48
- Async::Task.new(&executer)
77
+ Async::Task.new(delay: 1, &executer)
49
78
  end
50
79
  # sync_exec kept for API compatibility reasons
51
80
  alias sync_exec async_exec