diff --git a/frontend/src/Metamaps/Filter.js b/frontend/src/Metamaps/Filter.js index f67c6ec8..59aa1bae 100644 --- a/frontend/src/Metamaps/Filter.js +++ b/frontend/src/Metamaps/Filter.js @@ -186,7 +186,7 @@ const Filter = { $('#filter_by_' + listToModify + ' li[data-id="' + identifier + '"]').fadeOut('fast', function () { $(this).remove() }) - index = self.visible[filtersToUse].indexOf(identifier) + const index = self.visible[filtersToUse].indexOf(identifier) self.visible[filtersToUse].splice(index, 1) }) diff --git a/frontend/src/components/Header.js b/frontend/src/components/Header.js index c8c67619..ee4184d5 100644 --- a/frontend/src/components/Header.js +++ b/frontend/src/components/Header.js @@ -1,9 +1,9 @@ import React, { Component, PropTypes } from 'react' -import { objectWithoutProperties } from '../utils' +import _ from 'lodash' const MapLink = props => { const { show, text, href, linkClass } = props - const otherProps = objectWithoutProperties(props, ['show', 'text', 'href', 'linkClass']) + const otherProps = _.omit(props, ['show', 'text', 'href', 'linkClass']) if (!show) { return null } diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js deleted file mode 100644 index 1743b9b5..00000000 --- a/frontend/src/utils/index.js +++ /dev/null @@ -1,9 +0,0 @@ -export const objectWithoutProperties = (obj, keys) => { - const target = {} - for (let i in obj) { - if (keys.indexOf(i) !== -1) continue - if (!Object.prototype.hasOwnProperty.call(obj, i)) continue - target[i] = obj[i] - } - return target -}