summaryrefslogtreecommitdiffstats
path: root/jquery.once.min.js
blob: ff683be2080b495a391a216f821d088ae958b804 (plain)
1
2
3
4
/*! jQuery Once - v2.0.0-alpha.9 - 12/15/2014 - https://github.com/RobLoach/jquery-once
 * (c) 2014 Rob Loach (http://github.com/RobLoach)
 * Licensed GPL-2.0, MIT */
!function(a){"use strict";"object"==typeof exports?a(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";a.fn.once=function(b){if(b=b||"once","string"!=typeof b)throw new Error("jQuery.once() parameter MUST be a string");var c="jquery-once-"+b;return this.filter(function(){return a(this).data(c)!==!0}).data(c,!0)},a.fn.removeOnce=function(a){return this.findOnce(a).removeData("jquery-once-"+a)},a.fn.findOnce=function(b){var c="jquery-once-"+b;return this.filter(function(){return a(this).data(c)===!0})}});