style: some whitespaces, line-breaks...

This commit is contained in:
vieron
2013-10-26 19:52:10 +02:00
parent d0ca62826a
commit 8e58cf8a44
2 changed files with 18 additions and 17 deletions
+9 -9
View File
@@ -6,7 +6,7 @@
* Licensed under the MIT licenses. * Licensed under the MIT licenses.
*/ */
;(function($, window, document, undefined){ ;(function($, window, document, undefined) {
var defaults = { var defaults = {
items: 'li', items: 'li',
@@ -19,9 +19,9 @@
container_width: 0, // 0 == auto container_width: 0, // 0 == auto
move_element: true, move_element: true,
helper: false // or 'clone' helper: false // or 'clone'
// drag: function(e){}, // drag: function(e) {},
// start : function(e, ui){}, // start : function(e, ui) {},
// stop : function(e){} // stop : function(e) {}
}; };
var $window = $(window); var $window = $(window);
@@ -130,7 +130,7 @@
if (this.options.limit) { if (this.options.limit) {
if (left > this.player_max_left) { if (left > this.player_max_left) {
left = this.player_max_left; left = this.player_max_left;
}else if(left < this.player_min_left) { } else if(left < this.player_min_left) {
left = this.player_min_left; left = this.player_min_left;
} }
} }
@@ -216,7 +216,7 @@
this.mouse_init_pos = this.get_mouse_pos(e); this.mouse_init_pos = this.get_mouse_pos(e);
this.offsetY = this.mouse_init_pos.top - this.el_init_pos.top; this.offsetY = this.mouse_init_pos.top - this.el_init_pos.top;
this.$body.on(pointer_events.move, function(mme){ this.$body.on(pointer_events.move, function(mme) {
var mouse_actual_pos = self.get_mouse_pos(mme); var mouse_actual_pos = self.get_mouse_pos(mme);
var diff_x = Math.abs( var diff_x = Math.abs(
mouse_actual_pos.left - self.mouse_init_pos.left); mouse_actual_pos.left - self.mouse_init_pos.left);
@@ -260,9 +260,10 @@
this.$helper = this.$player.clone() this.$helper = this.$player.clone()
.appendTo(this.$container).addClass('helper'); .appendTo(this.$container).addClass('helper');
this.helper = true; this.helper = true;
}else{ } else {
this.helper = false; this.helper = false;
} }
this.scrollOffset = 0; this.scrollOffset = 0;
this.el_init_offset = this.$player.offset(); this.el_init_offset = this.$player.offset();
this.player_width = this.$player.width(); this.player_width = this.$player.width();
@@ -337,8 +338,7 @@
this.disabled = true; this.disabled = true;
}; };
fn.destroy = function() {
fn.destroy = function(){
this.disable(); this.disable();
this.$container.off('.gridster-draggable'); this.$container.off('.gridster-draggable');
+9 -8
View File
@@ -112,7 +112,8 @@
this.$wrapper.addClass('ready'); this.$wrapper.addClass('ready');
this.draggable(); this.draggable();
$(window).bind('resize.gridster', throttle($.proxy(this.recalculate_faux_grid, this), 200)); $(window).bind('resize.gridster', throttle(
$.proxy(this.recalculate_faux_grid, this), 200));
}; };
@@ -692,10 +693,9 @@
* *
* @method on_start_drag * @method on_start_drag
* @param {Event} event The original browser event * @param {Event} event The original browser event
* @param {Object} ui A prepared ui object. * @param {Object} ui A prepared ui object with useful drag-related data
*/ */
fn.on_start_drag = function(event, ui) { fn.on_start_drag = function(event, ui) {
this.$helper.add(this.$player).add(this.$wrapper).addClass('dragging'); this.$helper.add(this.$player).add(this.$wrapper).addClass('dragging');
this.$player.addClass('player'); this.$player.addClass('player');
@@ -717,7 +717,6 @@
this.last_cols = []; this.last_cols = [];
this.last_rows = []; this.last_rows = [];
// see jquery.collision.js // see jquery.collision.js
this.collision_api = this.$helper.collision( this.collision_api = this.$helper.collision(
colliders, this.options.collision); colliders, this.options.collision);
@@ -743,7 +742,7 @@
* *
* @method on_drag * @method on_drag
* @param {Event} event The original browser event * @param {Event} event The original browser event
* @param {Object} ui A prepared ui object. * @param {Object} ui A prepared ui object with useful drag-related data
*/ */
fn.on_drag = function(event, ui) { fn.on_drag = function(event, ui) {
//break if dragstop has been fired //break if dragstop has been fired
@@ -786,7 +785,7 @@
* *
* @method on_stop_drag * @method on_stop_drag
* @param {Event} event The original browser event * @param {Event} event The original browser event
* @param {Object} ui A prepared ui object. * @param {Object} ui A prepared ui object with useful drag-related data
*/ */
fn.on_stop_drag = function(event, ui) { fn.on_stop_drag = function(event, ui) {
this.$helper.add(this.$player).add(this.$wrapper) this.$helper.add(this.$player).add(this.$wrapper)
@@ -794,7 +793,8 @@
ui.position.left = ui.position.left + this.baseX; ui.position.left = ui.position.left + this.baseX;
ui.position.top = ui.position.top + this.baseY; ui.position.top = ui.position.top + this.baseY;
this.colliders_data = this.collision_api.get_closest_colliders(ui.position); this.colliders_data = this.collision_api.get_closest_colliders(
ui.position);
this.on_overlapped_column_change( this.on_overlapped_column_change(
this.on_start_overlapping_column, this.on_start_overlapping_column,
@@ -1347,8 +1347,9 @@
}, this)); }, this));
} }
var $widgets_under_ph = this.get_widgets_under_player(
this.cells_occupied_by_placeholder);
var $widgets_under_ph = this.get_widgets_under_player(this.cells_occupied_by_placeholder);
if ($widgets_under_ph.length) { if ($widgets_under_ph.length) {
$widgets_under_ph.each($.proxy(function(i, widget) { $widgets_under_ph.each($.proxy(function(i, widget) {
var $w = $(widget); var $w = $(widget);