Skip to content

Commit d4ec714

Browse files
activeworxvieron
authored andcommittedOct 28, 2013
feat(resize): Add start/stop/resize callbacks
1 parent 277d8a7 commit d4ec714

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 

‎src/jquery.gridster.js

+18
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@
100100
* @param {Array} [options.resize.max_size] Limit widget dimensions
101101
* when resizing. Array values should be integers:
102102
* `[max_cols_occupied, max_rows_occupied]`
103+
* @param {Function} [options.resize.start] Function executed
104+
* when resizing starts.
105+
* @param {Function} [otions.resize.resize] Function executed
106+
* during the resizing.
107+
* @param {Function} [options.resize.stop] Function executed
108+
* when resizing stops.
103109
*
104110
* @constructor
105111
*/
@@ -1043,6 +1049,10 @@
10431049
}).appendTo(this.$el);
10441050

10451051
this.$resized_widget.addClass('resizing');
1052+
1053+
if (this.options.resize.start) {
1054+
this.options.resize.start.call(this, event, ui, this.$resized_widget);
1055+
}
10461056
};
10471057

10481058

@@ -1069,6 +1079,10 @@
10691079
'min-height': ''
10701080
});
10711081
}, this), 300);
1082+
1083+
if (this.options.resize.stop) {
1084+
this.options.resize.stop.call(this, event, ui, this.$resized_widget);
1085+
}
10721086
};
10731087

10741088
/**
@@ -1135,6 +1149,10 @@
11351149
});
11361150
}
11371151

1152+
if (this.options.resize.resize) {
1153+
this.options.resize.resize.call(this, event, ui, this.$resized_widget);
1154+
}
1155+
11381156
this.resize_last_sizex = size_x;
11391157
this.resize_last_sizey = size_y;
11401158
};

0 commit comments

Comments
 (0)