Sha256: 9444290b7697f2e59ad8cf2e9da697698c33abc07a06a3477d59bfa08c43b533
Contents?: true
Size: 776 Bytes
Versions: 12
Compression:
Stored size: 776 Bytes
Contents
require 'volt/page/bindings/base_binding' class ContentBinding < BaseBinding def initialize(target, context, binding_name, getter) # puts "new content binding: #{getter}" super(target, context, binding_name) # Find the source for the content binding @value = value_from_getter(getter) # Run the initial render update if @value.reactive? @changed_listener = @value.on('changed') { update } end end def update value = @value.cur.or('') # Exception values display the exception as a string value = value.to_s # Update the text in this section section.text = value end def remove if @changed_listener @changed_listener.remove @changed_listener = nil end super end end
Version data entries
12 entries across 12 versions & 1 rubygems