1/** 2 * Component Snippet 3 * @module Snippet 4 * @param {jQuery} $ Instance of jQuery 5 * @return {Object} List of Snippet methods 6 */ 7XA.component.snippet = (function($) { 8 /** 9 * This object stores all public api methods 10 * @type {Object.<Methods>} 11 * @memberOf module:Snippet 12 * @ 13 * */ 14 var api = {}, 15 instance; 16 /** 17 * initInstance method of a Snippet element 18 * @memberOf module:Snippet 19 * @method 20 * @param {jQuery} component Root DOM element of Snippet component wrapped by jQuery 21 * @param {jQuery} snippetModule Snippet inner DOM element of Snippet component wrapped by jQuery 22 * @alias module:Snippet.initInstance 23 */ 24 api.initInstance = function(component, snippetModule) {}; 25 /** 26 * init method calls in a loop for each 27 * snippet component on a page and runs Snippet's 28 * ["initInstance"]{@link module:Snippet.api.initInstance} methods. 29 * @memberOf module:Snippet 30 * @alias module:Snippet.init 31 */ 32 api.init = function() { 33 var $snippets = $(".snippet:not(.initialized)"); 34 $snippets.each(function() { 35 var $snippetModule = $(this).find(".snippet-inner"); 36 instance = $(this); 37 api.initInstance(instance, $snippetModule); 38 $(this).addClass("initialized"); 39 }); 40 }; 41 42 return api; 43})(jQuery); 44 45XA.register("snippet", XA.component.snippet);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.