Open michael opened 8 years ago
Currently we solve it like this:
In lens_writer.js:
lens_writer.js
this.handleStateUpdate = function(newState) { // var oldState = this.state; var doc = this.getDocument(); function getActiveNodes(state) { if (state.citationId) { var targets = doc.get(state.citationId).targets; return [ state.citationId ].concat(targets); } return []; } var activeAnnos = getActiveNodes(newState); // HACK: updates the highlights when state // transition has finished setTimeout(function() { doc.setHighlights(activeAnnos); }, 0); };
And in content_panel.js it's also a bit smelly:
content_panel.js
this.onHighlightsUpdated = function(highlights) { var controller = this.context.controller; // Triggers a rerender this.refs.scrollbar.extendProps({ highlights: highlights, contextId: controller.state.contextId }); };
We do this just to reach some proper coloring of the scrollbar according to the current context. Maybe we find better solution.
Currently we solve it like this:
In
lens_writer.js
:And in
content_panel.js
it's also a bit smelly:We do this just to reach some proper coloring of the scrollbar according to the current context. Maybe we find better solution.