code simplification in dashboard.js
Costa Tsaousis (ktsaou) committed
Feb 5, 2017 at 00:05 UTC
77fd0e809301569c80ae1d46de6d4b65e702b4b6
1 file changed
+9
-9
web/dashboard.js
+9
-9
@@ -1850,7 +1850,9 @@ var NETDATA = window.NETDATA || {};
1850
document.ontouchend =
1851
this.element_legend_childs.resize_handler.onmouseup =
1852
this.element_legend_childs.resize_handler.ontouchend =
1853
- function() {
1853
+ function(e) {
1854
+ void(e);
1855
+
1856
// remove all the hooks
1857
document.onmouseup =
1858
document.onmousemove =
@@ -1925,7 +1927,7 @@ var NETDATA = window.NETDATA || {};
1927
if(NETDATA.options.current.sync_selection === false)
1928
return false;
1929
1928
- return (!(NETDATA.globalSelectionSync.dont_sync_before > Date.now()));
1930
+ return (NETDATA.globalSelectionSync.dont_sync_before <= Date.now());
1931
};
1932
1933
this.globalSelectionSyncIsMaster = function() {
@@ -2056,7 +2058,7 @@ var NETDATA = window.NETDATA || {};
2058
this.clearSelection = function() {
2059
if(this.selected === true) {
2060
if(typeof this.library.clearSelection === 'function')
2059
- this.selected = (!(this.library.clearSelection(this) === true));
2061
+ this.selected = (this.library.clearSelection(this) !== true);
2062
else
2063
this.selected = false;
2064
@@ -4188,7 +4190,7 @@ var NETDATA = window.NETDATA || {};
4190
if(chart_type === 'stacked' && data.dimensions === 1) chart_type = 'area';
4191
chart_type = self.data('dygraph-type') || chart_type;
4192
4191
- var smooth = (chart_type === 'line' && !NETDATA.chartLibraries.dygraph.isSparkline(state));
4193
+ var smooth = (chart_type === 'line' && NETDATA.chartLibraries.dygraph.isSparkline(state) === false);
4194
smooth = self.data('dygraph-smooth') || smooth;
4195
4196
if(NETDATA.dygraph.smooth === false)
@@ -5940,7 +5942,7 @@ var NETDATA = window.NETDATA || {};
5942
if(typeof $().emulateTransitionEnd === 'function')
5943
return true;
5944
else {
5943
- return (typeof netdataNoBootstrap !== 'undefined' && netdataNoBootstrap);
5945
+ return (typeof netdataNoBootstrap !== 'undefined' && netdataNoBootstrap === true);
5946
}
5947
}
5948
},
@@ -5954,7 +5956,7 @@ var NETDATA = window.NETDATA || {};
5956
{
5957
url: NETDATA.themes.current.bootstrap_css,
5958
isAlreadyLoaded: function() {
5957
- return (typeof netdataNoBootstrap !== 'undefined' && netdataNoBootstrap);
5959
+ return (typeof netdataNoBootstrap !== 'undefined' && netdataNoBootstrap === true);
5960
}
5961
},
5962
{
@@ -6424,9 +6426,7 @@ var NETDATA = window.NETDATA || {};
6426
if(data) {
6427
NETDATA.registry.server = data.registry;
6428
NETDATA.registry.machine_guid = data.machine_guid;
6427
-
6428
- if(typeof data.hostname === 'string')
6429
- NETDATA.registry.hostname = data.hostname;
6429
+ NETDATA.registry.hostname = data.hostname;
6430
6431
NETDATA.registry.access(2, function (person_urls) {
6432
NETDATA.registry.parsePersonUrls(person_urls);