Metamaps.Filter bug and use _.omit instead of util function

This commit is contained in:
Devin Howard 2016-09-24 23:23:12 +08:00
parent 79aa7717ed
commit 045bd3fd73
3 changed files with 3 additions and 12 deletions

View file

@ -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)
})

View file

@ -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
}

View file

@ -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
}