Matthias Mullie has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/364217 )
Change subject: jQuery 3 support: stop using .bind
......................................................................
jQuery 3 support: stop using .bind
This updates jquery_lazyload to the current master
version (with the exception of using $.expr.pseudos
instead of $.expr[":"] still used in tuupola/jquery_lazyload)
Change-Id: If6a2bcccdca6110d2bf5fa8bf11980d4cc3f8767
---
M resources/jquery/jquery.lazyload.js
1 file changed, 5 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/17/364217/1
diff --git a/resources/jquery/jquery.lazyload.js
b/resources/jquery/jquery.lazyload.js
index b22b1e5..41c5898 100644
--- a/resources/jquery/jquery.lazyload.js
+++ b/resources/jquery/jquery.lazyload.js
@@ -77,7 +77,7 @@
/* Fire one scroll event per scroll. Not one scroll event per image. */
if (0 === settings.event.indexOf("scroll")) {
- $container.bind(settings.event, function() {
+ $container.on(settings.event, function() {
return update();
});
}
@@ -103,8 +103,7 @@
settings.appear.call(self, elements_left, settings);
}
$("<img />")
- .bind("load", function() {
-
+ .one("load", function() {
var original = $self.attr("data-" +
settings.data_attribute);
$self.hide();
if ($self.is("img")) {
@@ -134,7 +133,7 @@
/* When wanted event is triggered load original image */
/* by triggering appear. */
if (0 !== settings.event.indexOf("scroll")) {
- $self.bind(settings.event, function() {
+ $self.on(settings.event, function() {
if (!self.loaded) {
$self.trigger("appear");
}
@@ -143,14 +142,14 @@
});
/* Check if something appears when window is resized. */
- $window.bind("resize", function() {
+ $window.on("resize", function() {
update();
});
/* With IOS5 force loading images when navigating with back button. */
/* Non optimal workaround. */
if ((/(?:iphone|ipod|ipad).*os 5/gi).test(navigator.appVersion)) {
- $window.bind("pageshow", function(event) {
+ $window.on("pageshow", function(event) {
if (event.originalEvent && event.originalEvent.persisted) {
elements.each(function() {
$(this).trigger("appear");
--
To view, visit https://gerrit.wikimedia.org/r/364217
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If6a2bcccdca6110d2bf5fa8bf11980d4cc3f8767
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits