Fixes for eslint

This commit is contained in:
Winston Chang
2016-03-16 13:44:40 -05:00
parent 375d7cc7b1
commit 5331aa08a7
8 changed files with 18 additions and 25 deletions

View File

@@ -52,8 +52,6 @@ var FileProcessor = function(files) {
// It relies on the state of the object's fields to know what to do next.
this.$run = function() {
var self = this;
if (this.aborted || this.completed)
return;

View File

@@ -104,10 +104,10 @@ $.extend(selectInputBinding, {
this._selectize(el);
},
_selectize: function(el, update) {
if (!$.fn.selectize) return;
if (!$.fn.selectize) return undefined;
var $el = $(el);
var config = $el.parent().find('script[data-for="' + $escape(el.id) + '"]');
if (config.length === 0) return;
if (config.length === 0) return undefined;
var options = $.extend({
labelField: 'label',
valueField: 'value',

View File

@@ -16,8 +16,9 @@ $.extend(bootstrapTabInputBinding, {
anchors.each(function() {
if (self._getTabName($(this)) === value) {
$(this).tab('show');
return false;
return false; // Break out of each()
}
return true;
});
},
getState: function(el) {

View File

@@ -144,6 +144,7 @@ function debounce(threshold, func) {
// threshold of 1000ms, then calling it 17 times at
// 900ms intervals will result in something like 15
// or 16 executions of the underlying function.
// eslint-disable-next-line no-unused-vars
function throttle(threshold, func) {
var executionPending = false;
var timerId = null;

View File

@@ -480,7 +480,6 @@ imageutils.initCoordmap = function($el, coordmap) {
// trigger custom mousedown2 and dblclick2 events with this mousedown
// listener.
imageutils.createClickInfo = function($el, dblclickId, dblclickDelay) {
var clickCount = 0;
var clickTimer = null;
var pending_e = null; // A pending mousedown2 event
@@ -1078,7 +1077,7 @@ imageutils.createBrush = function($el, opts, coordmap, expandPixels) {
// will fit the box bounds into the panel, so we don't brush outside of it.
// This knows whether we're brushing in the x, y, or xy directions, and sets
// bounds accordingly.
// If no box is passed in, return current bounds.
// If no box is passed in, just return current bounds.
function boundsPx(box) {
if (box === undefined)
return state.boundsPx;
@@ -1126,6 +1125,7 @@ imageutils.createBrush = function($el, opts, coordmap, expandPixels) {
// brush. This should be fast because it doesn't actually modify the DOM.
$div.data('bounds-data', state.boundsData);
$div.data('panel', state.panel);
return undefined;
}
// Get or set the bounds of the brush using coordinates in the data space.
@@ -1148,6 +1148,7 @@ imageutils.createBrush = function($el, opts, coordmap, expandPixels) {
ymin: Math.min(minPx.y, maxPx.y),
ymax: Math.max(minPx.y, maxPx.y)
});
return undefined;
}
function getPanel() {
@@ -1209,6 +1210,7 @@ imageutils.createBrush = function($el, opts, coordmap, expandPixels) {
return state.down;
state.down = offset;
return undefined;
}
function up(offset) {
@@ -1216,6 +1218,7 @@ imageutils.createBrush = function($el, opts, coordmap, expandPixels) {
return state.up;
state.up = offset;
return undefined;
}
function isBrushing() {

View File

@@ -239,7 +239,7 @@ var ShinyApp = function() {
this.receiveOutput = function(name, value) {
if (this.$values[name] === value)
return;
return undefined;
this.$values[name] = value;
delete this.$errors[name];

View File

@@ -7,10 +7,6 @@ function escapeHTML(str) {
.replace(/\//g,"/");
}
function randomId() {
return Math.floor(0x100000000 + (Math.random() * 0xF00000000)).toString(16);
}
function strToBool(str) {
if (!str || !str.toLowerCase)
return undefined;
@@ -130,16 +126,6 @@ function makeBlob(parts) {
}
}
function slice(blob, start, end) {
if (blob.slice)
return blob.slice(start, end);
if (blob.mozSlice)
return blob.mozSlice(start, end);
if (blob.webkitSlice)
return blob.webkitSlice(start, end);
throw "Blob doesn't support slice";
}
function pixelRatio() {
if (window.devicePixelRatio) {
return window.devicePixelRatio;