Skip to content

Commit

Permalink
Fix formatting, silence tests for map
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeaufort committed Feb 19, 2020
1 parent 87ed1c1 commit c6a5b90
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
4 changes: 4 additions & 0 deletions fec/fec/static/js/modules/data-map.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-undef */

'use strict';

/**
Expand Down Expand Up @@ -537,3 +539,5 @@ function tooltipTemplate(obj) {
module.exports = {
DataMap
};

/* eslint-enable no-undef */
42 changes: 24 additions & 18 deletions fec/fec/static/js/widgets/pres-finance-map-box.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* eslint-disable no-undef */
/* eslint-disable no-unused-vars */

'use strict';

/* global CustomEvent */
Expand Down Expand Up @@ -1171,36 +1174,36 @@ PresidentialFundsMap.prototype.handleExportRaisingClick = function(e) {
eg: function openDownloads() VS. const openDownloads = function()
*/

const openDownloads = function(){
console.log('callback')
const openDownloads = function() {
console.log('callback');

$(instance.downloadsWrapper).animate(
{
height: $(instance.downloadsWrapper).get(0).scrollHeight
},
1000,
function() {
$(this).height('auto');
})
}
{
height: $(instance.downloadsWrapper).get(0).scrollHeight
},
1000,
function() {
$(this).height('auto');
}
);
};

// Wait until the export area is in view before opening
window.onscroll = function() {
var wS = this.scrollY,
hT = instance.downloadsWrapper.getBoundingClientRect().top + wS,
hH = instance.downloadsWrapper.offsetHeight,
wH = window.innerHeight;
if (wS > (hT+hH-wH)){
openDownloads()
hT = instance.downloadsWrapper.getBoundingClientRect().top + wS,
hH = instance.downloadsWrapper.offsetHeight,
wH = window.innerHeight;
if (wS > hT + hH - wH) {
openDownloads();
}
};
//scroll to export area
this.downloadsWrapper.scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'nearest'
});

});

// TODO-done: show {selector_downloadsWrapper}
// TODO-done: animate the page scroll to the downloads section
Expand Down Expand Up @@ -1309,3 +1312,6 @@ function logUsage(candID, electionYear) {
}

new PresidentialFundsMap();

/* eslint-enable no-undef */
/* eslint-enable no-unused-vars */

0 comments on commit c6a5b90

Please sign in to comment.