diff options
author | Tomasz Mieszkowski <tomasz.mieszkowski@ext.allegro.pl> | 2014-09-05 14:39:42 +0200 |
---|---|---|
committer | Tomasz Mieszkowski <tomasz.mieszkowski@ext.allegro.pl> | 2014-09-05 14:39:42 +0200 |
commit | bec15b27ba25fa8d4ff72d84054cd33311a8a161 (patch) | |
tree | da63167f41ea9460e61ec74f029f80d71d010a31 | |
parent | f095351d856d4c4e4fd686adcb6dd3a34803e521 (diff) | |
download | tipboard-bec15b27ba25fa8d4ff72d84054cd33311a8a161.tar.gz tipboard-bec15b27ba25fa8d4ff72d84054cd33311a8a161.tar.bz2 tipboard-bec15b27ba25fa8d4ff72d84054cd33311a8a161.zip |
"typeof(x) === 'undefined'" instead of "x === void 0"
-rw-r--r-- | tipboard/static/js/tipboard.js | 8 | ||||
-rw-r--r-- | tipboard/tiles/big_value.js | 2 | ||||
-rw-r--r-- | tipboard/tiles/fancy_listing.js | 4 | ||||
-rw-r--r-- | tipboard/tiles/just_value.js | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/tipboard/static/js/tipboard.js b/tipboard/static/js/tipboard.js index ce0dce6..00c89c5 100644 --- a/tipboard/static/js/tipboard.js +++ b/tipboard/static/js/tipboard.js @@ -40,7 +40,7 @@ RendererFactory.prototype.rendererName2renderObj = { RendererFactory.prototype.createRenderer = function (rendererName) { var lower = rendererName.toLowerCase(); var rendererClass = RendererFactory.prototype.rendererName2renderObj[lower]; - if (rendererClass === void 0) { + if (typeof(rendererClass) === 'undefined') { throw new RendererFactory.prototype.UnknownRenderer(rendererName); } return rendererClass; @@ -413,7 +413,7 @@ var renderersSwapper = new RenderersSwapper(); return false; // break } }); - if (typeof nextFlipIdx !== void 0) { + if (typeof(nextFlipIdx) !== 'undefined') { var tileToFlip = containerFlips[nextFlipIdx]; $(tileToFlip).addClass("flippedforward"); } @@ -517,7 +517,7 @@ var renderersSwapper = new RenderersSwapper(); }, init: function() { - if ((this.websocket !== void 0) && !(this.websocket.readyState === WebSocket.CLOSED || this.websocket.readyState === WebSocket.CLOSING)) { + if ((typeof(this.websocket) !== 'undefined') && !(this.websocket.readyState === WebSocket.CLOSED || this.websocket.readyState === WebSocket.CLOSING)) { console.log("Closing outdated Web socket."); this.websocket.close(); return; // the rest will be handled in onClose() @@ -604,7 +604,7 @@ var renderersSwapper = new RenderersSwapper(); var tile = Tipboard.Dashboard.id2node(tileId); $.each(keysToUse, function(idx, key) { var value = dataToPut[key]; - if (value === void 0) { + if (typeof(value) === 'undefined') { var msg = 'WARN: No key "' + key + '" in data' console.log(msg, dataToPut); } else { diff --git a/tipboard/tiles/big_value.js b/tipboard/tiles/big_value.js index 6304624..6501c01 100644 --- a/tipboard/tiles/big_value.js +++ b/tipboard/tiles/big_value.js @@ -21,7 +21,7 @@ BigValueTile = { setBigValueColor: function(tileId, meta) { // DEPRECATED function, Tipboard.DisplayUtils.applyHighlighterConfig var color = meta['big_value_color']; - if (color !== void 0) { + if (typeof(color) !== 'undefined') { color = Tipboard.DisplayUtils.replaceFromPalette(color) var tile = Tipboard.Dashboard.id2node(tileId); var bigValue = $(tile).find('#' + tileId + '-big-value')[0] diff --git a/tipboard/tiles/fancy_listing.js b/tipboard/tiles/fancy_listing.js index 4217496..a6636b0 100644 --- a/tipboard/tiles/fancy_listing.js +++ b/tipboard/tiles/fancy_listing.js @@ -4,7 +4,7 @@ function updateTileFancyListing(tileId, data, config, tipboard) { var tile = Tipboard.Dashboard.id2node(tileId); var nodeToClone = FancyListing.initContainer(tile); - if (nodeToClone === void 0) { + if (typeof(nodeToClone) === 'undefined') { return false; } FancyListing.populateItems(tile, nodeToClone, data); @@ -20,7 +20,7 @@ Tipboard.Dashboard.registerUpdateFunction('fancy_listing', updateTileFancyListin FancyListing = { initContainer: function(tile) { var nodeToClone = $(tile).find('.fancy-listing-item')[0]; - if (nodeToClone === void 0) { + if (typeof(nodeToClone) === 'undefined') { console.log('ABORTING - no node to clone'); return false; } diff --git a/tipboard/tiles/just_value.js b/tipboard/tiles/just_value.js index a753388..b12b9d4 100644 --- a/tipboard/tiles/just_value.js +++ b/tipboard/tiles/just_value.js @@ -20,7 +20,7 @@ JustValue = { setJustValueColor: function(tileId, meta) { // DEPRECATED function, Tipboard.DisplayUtils.applyHighlighterConfig var color = meta['just-value-color']; - if (color !== void 0) { + if (typeof(color) !== 'undefined') { color = Tipboard.DisplayUtils.replaceFromPalette(color); var dst = $('#' + tileId + '-just-value').parent(); $(dst).css('background-color', color); |