Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Early polling marker changes from red to green on hover #69

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require.config({
bootstrapCarousel: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/carousel',
bootstrapCollapse: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/collapse',
bootstrapDropdown: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/dropdown',
bootstrapModal: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/modal',
bootstrapPopover: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/popover',
bootstrapScrollspy: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/scrollspy',
bootstrapTab: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/tab',
Expand Down Expand Up @@ -39,9 +38,6 @@ require.config({
bootstrapDropdown: {
deps: ['jquery']
},
bootstrapModal: {
deps: ['jquery', 'bootstrapTransition']
},
bootstrapPopover: {
deps: ['jquery', 'bootstrapTooltip']
},
Expand Down Expand Up @@ -187,7 +183,6 @@ require(['jquery',
var link = $('<a>').text(result.formatted_address).data('location', result.geometry.location).on('click', addressClickHandler);
$('<li>').append(link).appendTo($ul);
}
$('.modal').modal('hide');
}
}

Expand Down
8 changes: 8 additions & 0 deletions app/scripts/early_voting_mgr.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ define(
function whenMarkerEventsHappen(eventType, marker) {
if (eventType === 'click') {
for (var i = 0; i < earlyVotingLocations.length; i++) {

if (marker.getPosition().equals(earlyVotingLocations[i].getGeometry().get())) {

var collapsedToggle = Boolean(document.getElementById('#collapse-toggle'+i).getAttribute("aria-expanded"));

if (collapsedToggle) {
$('#collapse'+i).collapse('show');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how did this make its way into multiple pull requests :P we might not want to do this, based off some of the design stuff that @WheresHJ was showing, maybe we can talk about this on tuesday?

}

$el.scrollTo($('#location'+i), 800);
}
}
Expand Down
18 changes: 14 additions & 4 deletions app/scripts/map_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,23 @@ define(['json!vendor/EARLY_VOTING_AddressPoints.geojson'],

function createEarlyPollingMarkers() {
earlyPollingLocations.forEach(function(poll, index) {
var earlyVotingMarker = new google.maps.Marker({
var marker = new google.maps.Marker({
position: poll.getGeometry().get()

});
marker.addListener('click', function() {
fireMarkerEvent('click', marker);
});

marker.addListener('mouseover', function() {
marker.setIcon(hoverIcon);
});
earlyVotingMarker.addListener('click', function() {
fireMarkerEvent('click', earlyVotingMarker);

marker.addListener('mouseout', function() {
marker.setIcon(defaultIcon);
});
earlyPollingMarkers.push(earlyVotingMarker);

earlyPollingMarkers.push(marker);
});
}

Expand Down
2 changes: 0 additions & 2 deletions app/scripts/polling_location_finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ define(['jquery',

var destination = pollingLocation.getProperty('Address') + ', Cambridge, MA';
mapService.displayNewPollingPlace(latLng, destination, userPrecinct, successCallback, errorCallback);
// userPrecinct.setMap(map);
// map.fitBounds(userPrecinct.getBounds());

// display location notes
$('#info .location').text(pollingLocation.getProperty('LOCATION'));
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/templates/early_voting_sidebar.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div class="early-voting-location" id="location<%= i %>">
<div id="heading<%= i %>" role="tab">
<h4>
<a role="button" data-toggle="collapse" data-parent="#early-voting-sidebar" href="#collapse<%= i %>" aria-expanded="false" aria-controls="collapse<%= i %>">
<%= location.getProperty('LOCATION') %>
<a id="#collapse-toggle<%= i %>" role="button" data-toggle="collapse" data-parent="#early-voting-sidebar" href="#collapse<%= i %>" aria-expanded="false" aria-controls="collapse<%= i %>">
<%= location.getProperty('LOCATION') %>
</a>
</h4>
</div>
Expand Down