var args = Array.prototype.slice.call(arguments, 1);//collect all the arguments, if necessary
var plugClass = this.data('zfPlugin');//determine the class of plugin
- if(plugClass !== undefined && plugClass[method] !== undefined){//make sure both the class and method exist
+ if(typeof plugClass !== 'undefined' && typeof plugClass[method] !== 'undefined'){//make sure both the class and method exist
if(this.length === 1){//if there's only one, call it directly.
plugClass[method].apply(plugClass, args);
}else{
}
// Polyfill to get the name of a function in IE9
function functionName(fn) {
- if (Function.prototype.name === undefined) {
+ if (typeof Function.prototype.name === 'undefined') {
var funcNameRegex = /function\s([^(]{1,})\(/;
var results = (funcNameRegex).exec((fn).toString());
return (results && results.length > 1) ? results[1].trim() : "";
}
- else if (fn.prototype === undefined) {
+ else if (typeof fn.prototype === 'undefined') {
return fn.constructor.name;
}
else {
var $toClose;
if ($elem && $elem.length) {
$toClose = $elem;
- } else if (idx !== undefined) {
+ } else if (typeof idx !== 'undefined') {
$toClose = this.$tabs.not(function(i, el) {
return i === idx;
});
}else{
this._events();
}
- if((tooSmall !== undefined && tooSmall === false) || tooSmall === undefined){
+ if((typeof tooSmall !== 'undefined' && tooSmall === false) || typeof tooSmall === 'undefined'){
if(imgs.length){
onImagesLoaded(imgs, this._reflow.bind(this));
}else{
// Get the new active link
const $oldActive = this.$active;
let activeHash = '';
- if(activeIdx !== undefined){
+ if(typeof activeIdx !== 'undefined'){
this.$active = this.$links.filter('[href="#' + this.$targets.eq(activeIdx).data('magellan-target') + '"]');
if (this.$active.length) activeHash = this.$active[0].getAttribute('href');
}else{
// missing `=` should be `null`:
// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
- val = val === undefined ? null : decodeURIComponent(val);
+ val = typeof val === 'undefined' ? null : decodeURIComponent(val);
if (!ret.hasOwnProperty(key)) {
ret[key] = val;