jslinting

This commit is contained in:
vieron
2012-07-24 10:31:08 +02:00
parent 4eb679fb78
commit 443d0fbc29
4 changed files with 24 additions and 24 deletions

View File

@@ -46,10 +46,10 @@
var el = this.el; var el = this.el;
if (el && !update) { if (el && !update) {
this.data = {} || el.offset(); this.data = el.offset();
this.data.width = el.width(); this.data.width = el.width();
this.data.height = el.height(); this.data.height = el.height();
}; }
if (el && update && !not_update_offsets) { if (el && update && !not_update_offsets) {
var offset = el.offset(); var offset = el.offset();

View File

@@ -55,7 +55,7 @@
this.player_min_left = 0 + this.options.offset_left; this.player_min_left = 0 + this.options.offset_left;
this.init(); this.init();
}; }
var fn = Draggable.prototype; var fn = Draggable.prototype;
@@ -82,7 +82,7 @@
fn.drag_handler = function(e) { fn.drag_handler = function(e) {
if (e.which !== 1) { if (e.which !== 1) {
return false; return false;
}; }
var self = this; var self = this;
var first = true; var first = true;
@@ -108,7 +108,7 @@
if (self.is_dragging == true) { if (self.is_dragging == true) {
throttle(self.on_dragmove.call(self, mme), 130); throttle(self.on_dragmove.call(self, mme), 130);
}; }
return false; return false;
@@ -136,7 +136,7 @@
this.options.start.call(this.$player, e, { this.options.start.call(this.$player, e, {
helper: this.helper ? this.$helper : this.$player helper: this.helper ? this.$helper : this.$player
}); });
}; }
return false; return false;
}; };
@@ -156,12 +156,12 @@
}else if(left < this.player_min_left) { }else if(left < this.player_min_left) {
left = this.player_min_left; left = this.player_min_left;
} }
}; }
return { return {
left: left, left: left,
top: top top: top
} };
}; };
@@ -198,7 +198,7 @@
'left': offset.left, 'left': offset.left,
'top': offset.top 'top': offset.top
} }
} };
if (this.options.stop) { if (this.options.stop) {
this.options.stop.call(this.$player, e, ui); this.options.stop.call(this.$player, e, ui);

View File

@@ -115,7 +115,7 @@
this.$wrapper.find('.player-revert').removeClass('player-revert'); this.$wrapper.find('.player-revert').removeClass('player-revert');
this.drag_api.disable(); this.drag_api.disable();
return this; return this;
} };
/** /**
@@ -127,7 +127,7 @@
fn.enable = function() { fn.enable = function() {
this.drag_api.enable(); this.drag_api.enable();
return this; return this;
} };
/** /**
@@ -229,7 +229,7 @@
if (callback) { if (callback) {
callback.apply(this, el); callback.apply(this, el);
}; }
}, this)); }, this));
}; };
@@ -298,7 +298,7 @@
'data-sizex': wgd.size_x, 'data-sizex': wgd.size_x,
'data-sizey': wgd.size_y 'data-sizey': wgd.size_y
}); });
}; }
// attach Coord object to player data-coord attribute // attach Coord object to player data-coord attribute
$el.data('coords', $el.coords()); $el.data('coords', $el.coords());
@@ -469,7 +469,7 @@
var abs_offset = { var abs_offset = {
left: ui.position.left + this.baseX, left: ui.position.left + this.baseX,
top: ui.position.top + this.baseY top: ui.position.top + this.baseY
} };
this.colliders_data = this.collision_api.get_closest_colliders( this.colliders_data = this.collision_api.get_closest_colliders(
abs_offset); abs_offset);
@@ -741,7 +741,7 @@
* Sorts an Array of grid coords objects (representing the grid coords of * Sorts an Array of grid coords objects (representing the grid coords of
* each widget) placing first the empty cells upper left. * each widget) placing first the empty cells upper left.
* *
* @method sort_by_row_asc * @method sort_by_row_and_col_asc
* @param {Array} widgets Array of grid coords objects * @param {Array} widgets Array of grid coords objects
* @return {Array} Returns the array sorted. * @return {Array} Returns the array sorted.
*/ */
@@ -761,7 +761,7 @@
* Sorts an Array of grid coords objects by column (representing the grid * Sorts an Array of grid coords objects by column (representing the grid
* coords of each widget) in ascending way. * coords of each widget) in ascending way.
* *
* @method sort_by_row_asc * @method sort_by_col_asc
* @param {Array} widgets Array of grid coords objects * @param {Array} widgets Array of grid coords objects
* @return {Array} Returns the array sorted. * @return {Array} Returns the array sorted.
*/ */
@@ -1027,7 +1027,7 @@
var right_col = (col + phgd.size_x - 1); var right_col = (col + phgd.size_x - 1);
if (right_col > this.cols) { if (right_col > this.cols) {
col = col - (right_col - col); col = col - (right_col - col);
}; }
var moved_down = this.placeholder_grid_data.row < row; var moved_down = this.placeholder_grid_data.row < row;
var changed_column = this.placeholder_grid_data.col !== col; var changed_column = this.placeholder_grid_data.col !== col;
@@ -1926,19 +1926,19 @@
$widgets = $widgets.add( $widgets = $widgets.add(
this.$widgets.filter(function() { this.$widgets.filter(function() {
var tcol = $(this).attr('data-col'); var tcol = $(this).attr('data-col');
return (tcol == col || tcol > col); return (tcol === col || tcol > col);
}) })
); );
}; }
if (row) { if (row) {
$widgets = $widgets.add( $widgets = $widgets.add(
this.$widgets.filter(function() { this.$widgets.filter(function() {
var trow = $(this).attr('data-row'); var trow = $(this).attr('data-row');
return (trow == row || trow > row); return (trow === row || trow > row);
}) })
); );
}; }
return $widgets; return $widgets;
} }
@@ -1990,7 +1990,7 @@
// don't duplicate stylesheets for the same configuration // don't duplicate stylesheets for the same configuration
if ($.inArray(serialized_opts, Gridster.generated_stylesheets) >= 0) { if ($.inArray(serialized_opts, Gridster.generated_stylesheets) >= 0) {
return false; return false;
}; }
Gridster.generated_stylesheets.push(serialized_opts); Gridster.generated_stylesheets.push(serialized_opts);

View File

@@ -1,4 +1,4 @@
(function(window, undefined) { ;(function(window, undefined) {
/* Debounce and throttle functions taken from underscore.js */ /* Debounce and throttle functions taken from underscore.js */
window.debounce = function(func, wait, immediate) { window.debounce = function(func, wait, immediate) {
var timeout; var timeout;
@@ -38,4 +38,4 @@
}; };
}; };
})(window) })(window);