rx/presenters

View on GitHub
views/mdc/components/drag_and_drop/drag_and_drop.rb

Summary

Maintainability
A
0 mins
Test Coverage
def draggable_attributes(comp)
  draggable_attributes = ''
  if comp.draggable
    draggable_attributes = "draggable=true data-drag_params='#{comp.draggable.to_h.to_json}'"
  end
  draggable_attributes
end

def drop_zone_attributes(comp)
  drop_zone_attributes = ''
  if comp.drop_zone
    zone = comp.drop_zone[:zone]
    drop_zone_attributes = "data-dropzone='#{zone}' data-drop_params='#{comp.drop_zone.to_h.to_json}'"
  end
  drop_zone_attributes
end