lib/volt/page/targets/dom_template.rb
def update_binding_anchors!
    new_bindings = {}

    @binding_anchors.each_pair do |name, anchors|
      new_name = @@binding_number
      @@binding_number += 1

      if name.is_a?(String)
        if name[0..1] == 'id'
          # A generated id
          # update the id
          `anchors.setAttribute('id', 'id' + new_name);`

          new_bindings["id#{new_name}"] = @bindings[name]
        else
          # Assume a fixed id, should not be updated
          # TODO: Might want to check the page to see if a node
          # with this id already exists and raise if it does.

          # Copy from existing binding
          new_bindings[name] = @bindings[name]
        end
      else
        start_comment, end_comment = anchors

        %x{
          start_comment.textContent = " $" + new_name + " ";
          end_comment.textContent = " $/" + new_name + " ";
        }

        new_bindings[new_name] = @bindings[name]
      end
    end

    return new_bindings
  end
# Takes the binding_anchors and updates them with new numbers (comments and id's)
# then returns the bindings updated to the new numbers.
Takes the binding_anchors and updates them with new numbers (comments and id's)
then returns the bindings updated to the new numbers.
Takes the binding_anchors and updates them with new numbers ( comments and id ' s ) then returns the bindings updated to the new numbers .
def update_binding_anchors!
    new_bindings = {}
    @binding_anchors.each_pair do |name, anchors|
      new_name = @@binding_number
      @@binding_number += 1
      if name.is_a?(String)
        if name[0..1] == 'id'
          `anchors.setAttribute('id', 'id' + new_name);`
          new_bindings["id#{new_name}"] = @bindings[name]
        else
          new_bindings[name] = @bindings[name]
        end
      else
        start_comment, end_comment = anchors
        %x{
          start_comment.textContent = " $" + new_name + " ";
          end_comment.textContent = " $/" + new_name + " ";
        }
        new_bindings[new_name] = @bindings[name]
      end
    end
    return new_bindings
  end
def update_binding_anchors! new_bindings = { } @binding_anchors . each_pair do | name , anchors | new_name = @@binding_number @@binding_number += 1 if name . is_a? ( String ) if name [ 0 .. 1 ] == 'id' ` anchors.setAttribute('id', 'id' + new_name); ` new_bindings [ "id#{new_name}" ] = @bindings [ name ] else new_bindings [ name ] = @bindings [ name ] end else start_comment , end_comment = anchors %x{ 
          start_comment.textContent = " $" + new_name + " ";
          end_comment.textContent = " $/" + new_name + " ";
         } new_bindings [ new_name ] = @bindings [ name ] end end return new_bindings end
Takes the binding_anchors and updates them with new numbers (comments and id's)
then returns the bindings updated to the new numbers.
Takes the binding_anchors and updates them with new numbers ( comments and id ' s ) then returns the bindings updated to the new numbers .
# A generated id # update the id # Assume a fixed id, should not be updated # TODO: Might want to check the page to see if a node # with this id already exists and raise if it does. # Copy from existing binding