gridster.js icon indicating copy to clipboard operation
gridster.js copied to clipboard

jQuery.fn.bind() is deprecated

Open FGIKCM opened this issue 8 years ago • 0 comments

Hello,

In src/jquery.gridster.js, you have a $window.bind(). But with jQuery 3.x, window.bind() is deprecated, and must be replaced by .on():

As of jQuery 3.0, .bind() has been deprecated. It was superseded by the .on() method for attaching event handlers to a document since jQuery 1.7, so its use was already discouraged.

I discovered it using the jQuery Migrate plugin.

But as I don't know what code you should write, I don't do a PR :) Perhaps:

$window.on('resize.gridster', throttle(
	$.proxy(this.recalculate_faux_grid, this), 200));
};

FGIKCM avatar Nov 06 '17 12:11 FGIKCM