Remove redundant HTML map classes
The `map` class is applied to the map element by LeafletJS; using it in the container led to hacks like adding an `inline` class to fix the fact that the container was using the `height` rule of the `.map` elements. Even though we don't add styles for them, I'm adding the `budgets-map` and `budget-investments-map` HTML classes so these elements can still be easily selected with CSS and JavaScript.
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
<div class="map">
|
||||
<div class="budget-investments-map">
|
||||
<%= render_map(map_location, investments_coordinates: coordinates) %>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
class Budgets::Investments::MapComponent < ApplicationComponent
|
||||
attr_reader :heading, :investments
|
||||
delegate :render_map, to: :helpers
|
||||
|
||||
def initialize(investments, heading:)
|
||||
@investments = investments
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="map inline">
|
||||
<div class="budgets-map">
|
||||
<h2><%= t("budgets.index.map") %></h2>
|
||||
<%= render_map(nil, investments_coordinates: coordinates) %>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@ describe Budgets::MapComponent do
|
||||
|
||||
render_inline Budgets::MapComponent.new(budget)
|
||||
|
||||
expect(page.first("div.map")).to have_content "located geographically"
|
||||
expect(page.find(".budgets-map")).to have_content "located geographically"
|
||||
end
|
||||
|
||||
it "is not rendered during the informing phase" do
|
||||
|
||||
Reference in New Issue
Block a user