diff --git a/History.md b/History.md index dd0bdabfdd..a3e94ac32d 100644 --- a/History.md +++ b/History.md @@ -58,7 +58,7 @@ * Fix races when calling login and/or logoutOtherClients from multiple tabs. #1616 -* Upgrade `jquery-waypoints` package from 1.1.7 to 2.0.3. (Contains +* Upgrade `jquery-waypoints` package from 1.1.7 to 2.0.4. (Contains backward-incompatible changes). * Add `frame-src` to `browser-policy-content` and account for diff --git a/packages/jquery-waypoints/waypoints.js b/packages/jquery-waypoints/waypoints.js index 81da414443..2987f8711c 100644 --- a/packages/jquery-waypoints/waypoints.js +++ b/packages/jquery-waypoints/waypoints.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript 1.6.2 /* -jQuery Waypoints - v2.0.3 -Copyright (c) 2011-2013 Caleb Troughton +jQuery Waypoints - v2.0.4 +Copyright (c) 2011-2014 Caleb Troughton Dual licensed under the MIT license and GPL license. https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt */ @@ -54,7 +54,7 @@ https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt horizontal: {}, vertical: {} }; - $element.data(contextKey, this.id); + this.element[contextKey] = this.id; contexts[this.id] = this; $element.bind(scrollEvent, function() { var scrollHandler; @@ -230,9 +230,9 @@ https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt this.options = options; context.waypoints[this.axis][this.id] = this; allWaypoints[this.axis][this.id] = this; - idList = (_ref = $element.data(waypointKey)) != null ? _ref : []; + idList = (_ref = this.element[waypointKey]) != null ? _ref : []; idList.push(this.id); - $element.data(waypointKey, idList); + this.element[waypointKey] = idList; } Waypoint.prototype.trigger = function(args) { @@ -265,7 +265,7 @@ https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt Waypoint.getWaypointsByElement = function(element) { var all, ids; - ids = $(element).data(waypointKey); + ids = element[waypointKey]; if (!ids) { return []; } @@ -297,7 +297,7 @@ https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt contextElement = $this.closest(contextElement); } contextElement = $(contextElement); - context = contexts[contextElement.data(contextKey)]; + context = contexts[contextElement[0][contextKey]]; if (!context) { context = new Context(contextElement); } @@ -307,13 +307,13 @@ https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt return this; }, disable: function() { - return methods._invoke(this, 'disable'); + return methods._invoke.call(this, 'disable'); }, enable: function() { - return methods._invoke(this, 'enable'); + return methods._invoke.call(this, 'enable'); }, destroy: function() { - return methods._invoke(this, 'destroy'); + return methods._invoke.call(this, 'destroy'); }, prev: function(axis, selector) { return methods._traverse.call(this, axis, selector, function(stack, index, waypoints) { @@ -348,8 +348,8 @@ https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt }); return this.pushStack(stack); }, - _invoke: function($elements, method) { - $elements.each(function() { + _invoke: function(method) { + this.each(function() { var waypoints; waypoints = Waypoint.getWaypointsByElement(this); @@ -401,7 +401,7 @@ https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt collection = allWaypoints; if (contextSelector) { - collection = (_ref = contexts[$(contextSelector).data(contextKey)]) != null ? _ref.waypoints : void 0; + collection = (_ref = contexts[$(contextSelector)[0][contextKey]]) != null ? _ref.waypoints : void 0; } if (!collection) { return []; @@ -480,7 +480,7 @@ https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt _filter: function(selector, axis, test) { var context, waypoints; - context = contexts[$(selector).data(contextKey)]; + context = contexts[$(selector)[0][contextKey]]; if (!context) { return []; }