lib/volt/page/targets/dom_template.rb
# Finds each of the binding anchors in the temp dom, then stores a reference
# to them so they can be quickly updated without using xpath to find them again.
Finds each of the binding anchors in the temp dom, then stores a reference
to them so they can be quickly updated without using xpath to find them again.
Finds each of the binding anchors in the temp dom then stores a reference to them so they can be quickly updated without using xpath to find them again .
def track_binding_anchors
    @binding_anchors = {}
    @bindings.each_pair do |name,binding|
      if name.is_a?(String)
        node = nil
        %x{
          node = self.nodes.querySelector('#' + name);
        }
        @binding_anchors[name] = node
      else
        start_comment = find_by_comment("$#{name}", @nodes)
        end_comment = find_by_comment("$/#{name}", @nodes)
        @binding_anchors[name] = [start_comment, end_comment]
      end
    end
  end
def track_binding_anchors @binding_anchors = { } @bindings . each_pair do | name , binding | if name . is_a? ( String ) node = nil %x{ 
          node = self.nodes.querySelector('#' + name);
         } @binding_anchors [ name ] = node else start_comment = find_by_comment ( "$#{name}" , @nodes ) end_comment = find_by_comment ( "$/#{name}" , @nodes ) @binding_anchors [ name ] = [ start_comment , end_comment ] end end end
Finds each of the binding anchors in the temp dom, then stores a reference
to them so they can be quickly updated without using xpath to find them again.
Finds each of the binding anchors in the temp dom then stores a reference to them so they can be quickly updated without using xpath to find them again .
# Loop through the bindings, find in nodes. # Find the dom node for an attribute anchor # Find the dom node for a comment anchor