|
104 | 104 | }
|
105 | 105 |
|
106 | 106 | while (true) {
|
107 |
| - var collision_node = _.find(this.nodes, function(n) { |
| 107 | + var collision_node = _.find(this.nodes, _.bind(function(n) { |
108 | 108 | return n != node && Utils.is_intercepted(n, nn);
|
109 |
| - }, this); |
| 109 | + }, this)); |
110 | 110 | if (typeof collision_node == 'undefined') {
|
111 | 111 | return;
|
112 | 112 | }
|
|
117 | 117 |
|
118 | 118 | GridStackEngine.prototype.is_area_empty = function(x, y, width, height) {
|
119 | 119 | var nn = {x: x || 0, y: y || 0, width: width || 1, height: height || 1};
|
120 |
| - var collision_node = _.find(this.nodes, function(n) { |
| 120 | + var collision_node = _.find(this.nodes, _.bind(function(n) { |
121 | 121 | return Utils.is_intercepted(n, nn);
|
122 |
| - }, this); |
| 122 | + }, this)); |
123 | 123 | return collision_node == null;
|
124 | 124 | };
|
125 | 125 |
|
|
131 | 131 | this._sort_nodes();
|
132 | 132 |
|
133 | 133 | if (this.float) {
|
134 |
| - _.each(this.nodes, function(n, i) { |
| 134 | + _.each(this.nodes, _.bind(function(n, i) { |
135 | 135 | if (n._updating || typeof n._orig_y == 'undefined' || n.y == n._orig_y)
|
136 | 136 | return;
|
137 | 137 |
|
|
150 | 150 | }
|
151 | 151 | --new_y;
|
152 | 152 | }
|
153 |
| - }, this); |
| 153 | + }, this)); |
154 | 154 | }
|
155 | 155 | else {
|
156 |
| - _.each(this.nodes, function(n, i) { |
| 156 | + _.each(this.nodes, _.bind(function(n, i) { |
157 | 157 | if (n.locked)
|
158 | 158 | return;
|
159 | 159 | while (n.y > 0) {
|
|
176 | 176 | n._dirty = n.y != new_y;
|
177 | 177 | n.y = new_y;
|
178 | 178 | }
|
179 |
| - }, this); |
| 179 | + }, this)); |
180 | 180 | }
|
181 | 181 | };
|
182 | 182 |
|
|
753 | 753 | };
|
754 | 754 |
|
755 | 755 | GridStack.prototype.remove_all = function(detach_node) {
|
756 |
| - _.each(this.grid.nodes, function(node) { |
| 756 | + _.each(this.grid.nodes, _.bind(function(node) { |
757 | 757 | this.remove_widget(node.el, detach_node);
|
758 |
| - }, this); |
| 758 | + }, this)); |
759 | 759 | this.grid.nodes = [];
|
760 | 760 | this._update_container_height();
|
761 | 761 | };
|
|
0 commit comments