summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/model/core.js12
-rw-r--r--src/client/view/graph_view.js12
2 files changed, 12 insertions, 12 deletions
diff --git a/src/client/model/core.js b/src/client/model/core.js
index fb037832..4a7e9a7d 100644
--- a/src/client/model/core.js
+++ b/src/client/model/core.js
@@ -47,10 +47,10 @@ define(['util'], function(util) {
}
function init(config){
- if (config['rand_id_generator'] == 'hash') {
+ if (config.rand_id_generator === 'hash') {
random_id = random_id__hash;
}
- if (config['rand_id_generator'] == 'seq') {
+ if (config.rand_id_generator === 'seq') {
random_id = random_id__seq();
}
}
@@ -58,7 +58,7 @@ define(['util'], function(util) {
function Node() {
}
Node.prototype.equals = function(other_node){
- return this.id == other_node.id;
+ return this.id === other_node.id;
};
function Link() {
@@ -77,17 +77,17 @@ define(['util'], function(util) {
*/
function create_node_from_spec(node_spec) {
- util.assert(undefined != node_spec.name, 'create_node_from_spec: name missing');
+ util.assert(undefined !== node_spec.name, 'create_node_from_spec: name missing');
var ret = new Node();
- if (undefined != node_spec.id) {
+ if (undefined !== node_spec.id) {
// reuse id if present
__set_obj_id(ret, node_spec.id);
}
// type
- if (undefined == node_spec.type) {
+ if (undefined === node_spec.type) {
console.debug('create_node_from_spec: undefined type, falling back to \'perm\'');
node_spec.type = 'perm';
}
diff --git a/src/client/view/graph_view.js b/src/client/view/graph_view.js
index da0a3435..687b766f 100644
--- a/src/client/view/graph_view.js
+++ b/src/client/view/graph_view.js
@@ -530,7 +530,7 @@ function GraphView(spec) {
.attr('id', function(d){ return text_link_id(d.id); }) // append link id to enable data->visual mapping
.attr("text-anchor", "middle")
.attr("class", "linklabel graph")
- .on("click", function(d, i) {
+ .on("click", function(d) {
if (!temporary) { // FIXME: if temporary don't even put a click handler
svgInput.enable(this, d);
}
@@ -561,7 +561,7 @@ function GraphView(spec) {
link_g.each(function (d) {
link_on_hover(d);
});
- link_g.on("click", function(d, i) {
+ link_g.on("click", function(d) {
if (zoomInProgress) {
// don't disable zoomInProgress, it will be disabled by the svg_click_handler
// after this events bubbles to the svg element
@@ -573,8 +573,8 @@ function GraphView(spec) {
//var selected_N = selection:
- link.attr("class", function(d, i){
- var temp_and = (d.name && d.name.replace(/ /g,"")=="and" && temporary) ? "temp_and" : "";
+ link.attr("class", function(d){
+ var temp_and = (d.name && d.name.replace(/ /g,"") === "and" && temporary) ? "temp_and" : "";
return ["graph link", temp_and, selection.class__link(d, temporary)].join(' ');
});
@@ -640,7 +640,7 @@ function GraphView(spec) {
d.height = 900;
});
- function load_image(element, image_url, set_href) {
+ function load_image(element, image_url) {
var image = new Image();
image.onload = function () {
@@ -673,7 +673,7 @@ function GraphView(spec) {
load_image(this, "/static/img/url-icon.png");
});
- function node__click_handler(d, i) {
+ function node__click_handler(d, _i) {
if (d3.event.defaultPrevented) {
// drag happened, ignore click https://github.com/mbostock/d3/wiki/Drag-Behavior#on
return;