Skip to content

Commit

Permalink
revert back removal of init and explain why it is needed
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed May 31, 2017
1 parent 884f43c commit a73f003
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion library/cwm/src/lib/cwm/replace_point.rb
Expand Up @@ -20,7 +20,16 @@ def initialize(id: "_placeholder", widget: Empty.new("_initial_placeholder"))

# @return [UITerm]
def contents
ReplacePoint(Id(widget_id), @widget)
# Use for contents empty widget, because if @widget passed to constructor
# will be used then CWM itself will handle events for this initial widget.
# This is against replace point idea that replace point due to its dynamic
# content will handle events itself
ReplacePoint(Id(widget_id), Empty(Id("___cwm_rp_empty")))
end

# switches to initial widget
def init
replace(@widget)
end

# Replaces content with different widget. All its events are properly
Expand Down

0 comments on commit a73f003

Please sign in to comment.