Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class App extends Component {
/>
)}
</div>
<a href={window.optionPageURL} target="_blank" className='option-menu' id="option-menu" title="Options" style={{padding: '0px'}}><img role="presentation" id="option-menu-icon" src="images/icons/gear.png"/></a>
</div>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/ChartView.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ChartView extends Component {
createNewNodeValue(depthPath) {
let nodeData = this.props.data;
let pathSequence = [...depthPath];
if (pathSequence.length == 1) {
if (pathSequence.length === 1) {
return this.state.rootState;
}
pathSequence.reverse().splice(0, 1);
Expand Down Expand Up @@ -109,7 +109,7 @@ class ChartView extends Component {
let paths = hirarchy;
const newNodeData = this.createNewNodeValue(paths);
let newNode = {};
if (targetNode.depth == 0) {
if (targetNode.depth === 0) {
newNode = { ...newNodeData };
} else {
newNode[selectedNodeName] = newNodeData;
Expand Down
1 change: 0 additions & 1 deletion src/JSONInput.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from 'react';
import { initPlugin } from './utils/json-viewer/jquery.json-viewer.js';

class JSONInput extends Component {
constructor(props) {
Expand Down
18 changes: 8 additions & 10 deletions src/TreeView.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
var $ = require('jquery');
var jQuery = $;
import { initPlugin } from './utils/json-viewer/jquery.json-viewer.js';
import './utils/json-viewer/jquery.json-viewer.css';
import { initPlugin } from './utils/json-viewer/jquery.json-viewer.js';
var $ = require('jquery');

class TreeView extends Component {
constructor(props) {
Expand Down Expand Up @@ -38,6 +36,7 @@ class TreeView extends Component {
selection.addRange(selRange);
document.execCommand("Copy");
document.body.removeChild(selElement);
this.setState({showCopier: false});
}

changeCopyIconLocation(e) {
Expand Down Expand Up @@ -86,14 +85,14 @@ class TreeView extends Component {
let nodes = $(e.target).parentsUntil("#json-rb");
$(nodes).each(function (i, node) {

if ($(node).get(0).tagName == "LI" && $(node).parent()[0].tagName == "UL") {
if ($(node).get(0).tagName === "LI" && $(node).parent()[0].tagName === "UL") {
let parentKey = $(node).find("span.property").eq(0).text();
keys.push(self.getArrayIndex(parentKey.replace(/\"+/g, '')));
keys.push(self.getArrayIndex(parentKey.replace(/"+/g, '')));
}

if ($(node).get(0).tagName == "LI" && $(node).parent()[0].tagName == "OL") {
if ($(node).get(0).tagName === "LI" && $(node).parent()[0].tagName === "OL") {
var parentKey = $(node).parent("OL").parent("li").find("span.property").eq(0).text() + '[' + $(node).index() + ']';
keys.push(self.getArrayIndex(parentKey.replace(/\"+/g, '')));
keys.push(self.getArrayIndex(parentKey.replace(/"+/g, '')));
}

});
Expand Down Expand Up @@ -124,7 +123,6 @@ class TreeView extends Component {
componentDidMount() {
window.json = this.props.data;
this.$node = $(this.refs.jsonRenderer);

if ($) {
const pluginOptions = {
collapsed: false,
Expand All @@ -135,7 +133,7 @@ class TreeView extends Component {
$(document).on("click", "a.json-toggle", this.toggleSection);

setTimeout(() => {
if ((window.extensionOptions || {}).collapsed == true) {
if ((window.extensionOptions || {}).collapsed === true) {
$.each($('a.json-toggle'), function (index, item) {
if (index > 0) {
$(item).trigger('click');
Expand Down