Sha256: d65a918bcfc1312e3b4d89e5281da1ee63fe0f8a53a270fe573405f1a329ac16
Contents?: true
Size: 701 Bytes
Versions: 13
Compression:
Stored size: 701 Bytes
Contents
require 'volt/templates/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 @changed_listener = @value.on('changed') { update } 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 @changed_listener.remove @changed_listener = nil super end end
Version data entries
13 entries across 13 versions & 1 rubygems