diff --git a/app/assets/stylesheets/application.scss.erb b/app/assets/stylesheets/application.scss.erb index 8070bb97..14457520 100644 --- a/app/assets/stylesheets/application.scss.erb +++ b/app/assets/stylesheets/application.scss.erb @@ -1048,7 +1048,6 @@ label[for="user_remember_me"] { } .sidebarFilterBox { - display:none; width: 319px; padding: 16px 0; overflow-y: auto; diff --git a/frontend/src/Metamaps/Filter.js b/frontend/src/Metamaps/Filter.js index e8361bd3..6b7adaad 100644 --- a/frontend/src/Metamaps/Filter.js +++ b/frontend/src/Metamaps/Filter.js @@ -27,43 +27,6 @@ const Filter = { }, isOpen: false, changing: false, - toggleBox: function(event) { - var self = Filter - - if (self.isOpen) self.close() - else self.open() - - event.stopPropagation() - }, - open: function() { - var self = Filter - - GlobalUI.Account.close() - $('.sidebarFilterIcon div').addClass('hide') - - if (!self.isOpen && !self.changing) { - self.changing = true - - var height = $(document).height() - 108 - $('.sidebarFilterBox').css('max-height', height + 'px').fadeIn(200, function() { - self.changing = false - self.isOpen = true - }) - } - }, - close: function() { - var self = Filter - $('.sidebarFilterIcon div').removeClass('hide') - - if (!self.changing) { - self.changing = true - - $('.sidebarFilterBox').fadeOut(200, function() { - self.changing = false - self.isOpen = false - }) - } - }, reset: function() { var self = Filter self.filters.metacodes = [] diff --git a/frontend/src/Metamaps/GlobalUI/Account.js b/frontend/src/Metamaps/GlobalUI/Account.js index c06b45fc..59d9527d 100644 --- a/frontend/src/Metamaps/GlobalUI/Account.js +++ b/frontend/src/Metamaps/GlobalUI/Account.js @@ -17,7 +17,6 @@ const Account = { }, open: function() { var self = Account - Filter.close() $('.sidebarAccountIcon .tooltipsUnder').addClass('hide') if (!self.isOpen && !self.changing) { self.changing = true diff --git a/frontend/src/Metamaps/GlobalUI/ReactApp.js b/frontend/src/Metamaps/GlobalUI/ReactApp.js index a2a77f8b..d75d505f 100644 --- a/frontend/src/Metamaps/GlobalUI/ReactApp.js +++ b/frontend/src/Metamaps/GlobalUI/ReactApp.js @@ -188,7 +188,6 @@ const ReactApp = { const self = ReactApp return { filterData: Filter.dataForPresentation, - toggleFilterBox: Filter.toggleBox, allForFiltering: Filter.filters, visibleForFiltering: Filter.visible, toggleMetacode: Filter.toggleMetacode, diff --git a/frontend/src/Metamaps/JIT.js b/frontend/src/Metamaps/JIT.js index 7e0708de..4cf8a28a 100644 --- a/frontend/src/Metamaps/JIT.js +++ b/frontend/src/Metamaps/JIT.js @@ -1010,7 +1010,6 @@ const JIT = { Create.newTopic.open() } else if (!Mouse.didPan) { // SINGLE CLICK, no pan - Filter.close() TopicCard.hideCard() SynapseCard.hideCard() Create.newTopic.hide() diff --git a/frontend/src/Metamaps/Map/index.js b/frontend/src/Metamaps/Map/index.js index fad4cc0b..7eff2db4 100644 --- a/frontend/src/Metamaps/Map/index.js +++ b/frontend/src/Metamaps/Map/index.js @@ -142,7 +142,6 @@ const Map = { SynapseCard.hideCard() Create.newTopic.hide(true) // true means force (and override pinned) Create.newSynapse.hide() - Filter.close() InfoBox.close() Realtime.endActiveMap() self.requests = [] diff --git a/frontend/src/Metamaps/Topic.js b/frontend/src/Metamaps/Topic.js index 55b6c934..df5789c8 100644 --- a/frontend/src/Metamaps/Topic.js +++ b/frontend/src/Metamaps/Topic.js @@ -76,7 +76,6 @@ const Topic = { $('.rightclickmenu').remove() TopicCard.hideCard() SynapseCard.hideCard() - Filter.close() } }, centerOn: function(nodeid, callback) { diff --git a/frontend/src/components/MapView/MapButtons.js b/frontend/src/components/MapView/MapButtons.js index fbfe8a75..670e5ddd 100644 --- a/frontend/src/components/MapView/MapButtons.js +++ b/frontend/src/components/MapView/MapButtons.js @@ -8,7 +8,6 @@ class MapButtons extends Component { canEditMap: PropTypes.bool, onImportClick: PropTypes.func, onForkClick: PropTypes.func, - onFilterClick: PropTypes.func, filterData: PropTypes.object, allForFiltering: PropTypes.object, visibleForFiltering: PropTypes.object, @@ -20,10 +19,24 @@ class MapButtons extends Component { filterAllSynapses: PropTypes.func, } + constructor(props) { + super(props) + this.state = {filterBoxOpen: false} + } + + reset = () => { + this.setState({filterBoxOpen: false}) + } + + toggleFilterBox = event => { + this.setState({filterBoxOpen: !this.state.filterBoxOpen}) + } + render () { const { currentUser, canEditMap, filterBoxHtml, onFilterClick, onImportClick, onForkClick, filterData, allForFiltering, visibleForFiltering, toggleMetacode, toggleMapper, toggleSynapse, filterAllMetacodes, filterAllMappers, filterAllSynapses } = this.props + const { filterBoxOpen } = this.state return
{desc}