Last active
April 16, 2019 20:25
-
-
Save OlehDutchenko/ff07a5f5b24917c14b5e52f339a226c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* @module | |
*/ | |
// ---------------------------------------- | |
// Imports | |
// ---------------------------------------- | |
import $ from 'jquery'; | |
import 'custom-jquery-methods/fn/has-inited-key'; | |
// ---------------------------------------- | |
// Private | |
// ---------------------------------------- | |
/** | |
* @param {jQuery} \$element | |
* @private | |
*/ | |
function _init (\$element) { | |
console.log(\$element); | |
} | |
// ---------------------------------------- | |
// Public | |
// ---------------------------------------- | |
/** | |
* @param {jQuery} \$elements | |
*/ | |
export function ${moduleMethod} (\$elements) { | |
\$elements .each((i, element) => { | |
const \$element = $(element); | |
if (\$element .hasInitedKey('${moduleMethod}IsInitialized')) { | |
return true; | |
} | |
_init(\$element); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment