From 8e58cf8a4436f511a379d81a25aeb4a85380bb06 Mon Sep 17 00:00:00 2001 From: vieron Date: Fri, 25 Oct 2013 21:18:51 +0200 Subject: [PATCH] style: some whitespaces, line-breaks... --- src/jquery.draggable.js | 18 +++++++++--------- src/jquery.gridster.js | 17 +++++++++-------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/jquery.draggable.js b/src/jquery.draggable.js index ccbee1934..ea90417c7 100644 --- a/src/jquery.draggable.js +++ b/src/jquery.draggable.js @@ -6,7 +6,7 @@ * Licensed under the MIT licenses. */ -;(function($, window, document, undefined){ +;(function($, window, document, undefined) { var defaults = { items: 'li', @@ -19,9 +19,9 @@ container_width: 0, // 0 == auto move_element: true, helper: false // or 'clone' - // drag: function(e){}, - // start : function(e, ui){}, - // stop : function(e){} + // drag: function(e) {}, + // start : function(e, ui) {}, + // stop : function(e) {} }; var $window = $(window); @@ -130,7 +130,7 @@ if (this.options.limit) { if (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; } } @@ -216,7 +216,7 @@ this.mouse_init_pos = this.get_mouse_pos(e); 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 diff_x = Math.abs( mouse_actual_pos.left - self.mouse_init_pos.left); @@ -260,9 +260,10 @@ this.$helper = this.$player.clone() .appendTo(this.$container).addClass('helper'); this.helper = true; - }else{ + } else { this.helper = false; } + this.scrollOffset = 0; this.el_init_offset = this.$player.offset(); this.player_width = this.$player.width(); @@ -337,8 +338,7 @@ this.disabled = true; }; - - fn.destroy = function(){ + fn.destroy = function() { this.disable(); this.$container.off('.gridster-draggable'); diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index e47715fac..c293ce57b 100644 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -112,7 +112,8 @@ this.$wrapper.addClass('ready'); 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 * @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) { - this.$helper.add(this.$player).add(this.$wrapper).addClass('dragging'); this.$player.addClass('player'); @@ -717,7 +717,6 @@ this.last_cols = []; this.last_rows = []; - // see jquery.collision.js this.collision_api = this.$helper.collision( colliders, this.options.collision); @@ -743,7 +742,7 @@ * * @method on_drag * @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) { //break if dragstop has been fired @@ -786,7 +785,7 @@ * * @method on_stop_drag * @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) { this.$helper.add(this.$player).add(this.$wrapper) @@ -794,7 +793,8 @@ ui.position.left = ui.position.left + this.baseX; 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_start_overlapping_column, @@ -1347,8 +1347,9 @@ }, 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) { $widgets_under_ph.each($.proxy(function(i, widget) { var $w = $(widget);