|
203 | 203 |
|
204 | 204 | if (size_x > this.cols) {
|
205 | 205 | size_x = this.cols;
|
206 |
| - }; |
| 206 | + } |
207 | 207 |
|
208 | 208 | var old_cells_occupied = this.get_cells_occupied(wgd);
|
209 | 209 | var old_size_x = wgd.size_x;
|
|
217 | 217 | var diff = old_col + (size_x - 1) - this.cols;
|
218 | 218 | var c = old_col - diff;
|
219 | 219 | new_col = Math.max(1, c);
|
220 |
| - }; |
| 220 | + } |
221 | 221 |
|
222 | 222 | var new_grid_data = {
|
223 | 223 | col: new_col,
|
|
232 | 232 | $.each(old_cells_occupied.cols, function(i, col) {
|
233 | 233 | if ($.inArray(col, new_cells_occupied.cols) === -1) {
|
234 | 234 | empty_cols.push(col);
|
235 |
| - }; |
| 235 | + } |
236 | 236 | });
|
237 | 237 |
|
238 | 238 | var occupied_cols = [];
|
|
246 | 246 | $.each(old_cells_occupied.rows, function(i, row) {
|
247 | 247 | if ($.inArray(row, new_cells_occupied.rows) === -1) {
|
248 | 248 | empty_rows.push(row);
|
249 |
| - }; |
| 249 | + } |
250 | 250 | });
|
251 | 251 |
|
252 | 252 | var occupied_rows = [];
|
253 | 253 | $.each(new_cells_occupied.rows, function(i, row) {
|
254 | 254 | if ($.inArray(row, old_cells_occupied.rows) === -1) {
|
255 | 255 | occupied_rows.push(row);
|
256 |
| - }; |
| 256 | + } |
257 | 257 | });
|
258 | 258 |
|
259 | 259 | this.remove_from_gridmap(wgd);
|
|
263 | 263 | new_col, wgd.row, size_x, Math.min(old_size_y, size_y), $widget
|
264 | 264 | ];
|
265 | 265 | this.empty_cells.apply(this, cols_to_empty);
|
266 |
| - }; |
| 266 | + } |
267 | 267 |
|
268 | 268 | if (occupied_rows.length) {
|
269 | 269 | var rows_to_empty = [new_col, wgd.row, size_x, size_y, $widget];
|
270 | 270 | this.empty_cells.apply(this, rows_to_empty);
|
271 |
| - }; |
| 271 | + } |
272 | 272 |
|
273 | 273 | wgd.col = new_col;
|
274 | 274 | wgd.size_x = size_x;
|
|
342 | 342 |
|
343 | 343 | $nexts.not($exclude).each($.proxy(function(i, w) {
|
344 | 344 | var wgd = $(w).coords().grid;
|
345 |
| - if (!(wgd.row <= (row + size_y - 1))) { return; }; |
| 345 | + if (!(wgd.row <= (row + size_y - 1))) { return; } |
346 | 346 | var diff = (row + size_y) - wgd.row;
|
347 | 347 | this.move_widget_down($(w), diff);
|
348 | 348 | }, this));
|
|
382 | 382 | this.set_dom_grid_height();
|
383 | 383 |
|
384 | 384 | return this;
|
385 |
| - } |
| 385 | + }; |
386 | 386 |
|
387 | 387 |
|
388 | 388 | /**
|
|
400 | 400 | var ga = this.gridmap;
|
401 | 401 | var cols_l = ga.length;
|
402 | 402 | var valid_pos = [];
|
| 403 | + var rows_l; |
403 | 404 |
|
404 | 405 | for (var c = 1; c < cols_l; c++) {
|
405 |
| - var rows_l = ga[c].length; |
| 406 | + rows_l = ga[c].length; |
406 | 407 | for (var r = 1; r <= rows_l; r++) {
|
407 | 408 | var can_move_to = this.can_move_to({
|
408 | 409 | size_x: size_x,
|
|
534 | 535 | $el.data('coords').grid = wgd;
|
535 | 536 |
|
536 | 537 | this.add_to_gridmap(wgd, $el);
|
537 |
| - this.widgets.push($el); |
| 538 | + |
538 | 539 | return this;
|
539 | 540 | };
|
540 | 541 |
|
|
695 | 696 | //break if dragstop has been fired
|
696 | 697 | if (this.$player === null) {
|
697 | 698 | return false;
|
698 |
| - }; |
| 699 | + } |
699 | 700 |
|
700 | 701 | var abs_offset = {
|
701 | 702 | left: ui.position.left + this.baseX,
|
|
878 | 879 | var self = this;
|
879 | 880 | if (!no_player) {
|
880 | 881 | this.empty_cells_player_occupies();
|
881 |
| - }; |
| 882 | + } |
882 | 883 | var cell = !no_player ? self.colliders_data[0].el.data : {col: col};
|
883 | 884 | var to_col = cell.col;
|
884 | 885 | var to_row = row || cell.row;
|
|
967 | 968 | if (!a.row) {
|
968 | 969 | a = $(a).coords().grid;
|
969 | 970 | b = $(b).coords().grid;
|
970 |
| - }; |
| 971 | + } |
971 | 972 |
|
972 | 973 | if (a.row > b.row) {
|
973 | 974 | return 1;
|
|
989 | 990 | */
|
990 | 991 | fn.sort_by_row_and_col_asc = function(widgets) {
|
991 | 992 | widgets = widgets.sort(function(a, b) {
|
992 |
| - if (a.row > b.row || a.row == b.row && a.col > b.col) { |
| 993 | + if (a.row > b.row || a.row === b.row && a.col > b.col) { |
993 | 994 | return 1;
|
994 | 995 | }
|
995 | 996 | return -1;
|
|
1300 | 1301 | this.move_widget_down(
|
1301 | 1302 | $w, row + phgd.size_y - $w.data('coords').grid.row);
|
1302 | 1303 | }, this));
|
1303 |
| - }; |
| 1304 | + } |
1304 | 1305 |
|
1305 | 1306 | };
|
1306 | 1307 |
|
|
1381 | 1382 | if (this.is_widget(tcol, r) && !this.is_player_in(tcol, r)) {
|
1382 | 1383 | if (!grid_col[r].is(widget_grid_data.el)) {
|
1383 | 1384 | break;
|
1384 |
| - }; |
| 1385 | + } |
1385 | 1386 | }
|
1386 | 1387 |
|
1387 | 1388 | if (!this.is_player(tcol, r) &&
|
1388 | 1389 | !this.is_placeholder_in(tcol, r) &&
|
1389 | 1390 | !this.is_player_in(tcol, r)) {
|
1390 | 1391 | upper_rows[tcol].push(r);
|
1391 |
| - }; |
| 1392 | + } |
1392 | 1393 |
|
1393 | 1394 | if (r < min_row) {
|
1394 | 1395 | min_row = r;
|
|
2197 | 2198 | }
|
2198 | 2199 |
|
2199 | 2200 | return $widgets;
|
2200 |
| - } |
| 2201 | + }; |
2201 | 2202 |
|
2202 | 2203 |
|
2203 | 2204 | /**
|
|
2370 | 2371 | for (var r = max_rows; r > actual_rows; r--) {
|
2371 | 2372 | for (var c = this.cols; c >= 1; c--) {
|
2372 | 2373 | this.add_faux_cell(r, c);
|
2373 |
| - }; |
2374 |
| - }; |
| 2374 | + } |
| 2375 | + } |
2375 | 2376 |
|
2376 | 2377 | this.rows = max_rows;
|
2377 | 2378 |
|
|
2396 | 2397 | for (var c = actual_cols; c < max_cols; c++) {
|
2397 | 2398 | for (var r = this.rows; r >= 1; r--) {
|
2398 | 2399 | this.add_faux_cell(r, c);
|
2399 |
| - }; |
2400 |
| - }; |
| 2400 | + } |
| 2401 | + } |
2401 | 2402 |
|
2402 | 2403 | this.cols = max_cols;
|
2403 | 2404 |
|
|
2472 | 2473 |
|
2473 | 2474 | // get all rows that could be occupied by the current widgets
|
2474 | 2475 | var max_rows = this.options.extra_rows;
|
2475 |
| - this.$widgets.each(function(i, w){ |
| 2476 | + this.$widgets.each(function(i, w) { |
2476 | 2477 | max_rows += (+$(w).attr('data-sizey'));
|
2477 | 2478 | });
|
2478 | 2479 |
|
|
0 commit comments