Fix eslint errors
This commit is contained in:
parent
efe5348943
commit
a47f00e7a1
1 changed files with 13 additions and 11 deletions
24
index.js
24
index.js
|
|
@ -1,16 +1,18 @@
|
||||||
(function ($) {
|
/* global jQuery */
|
||||||
|
|
||||||
|
(($) => {
|
||||||
|
|
||||||
$.fn.aalert = function (method) {
|
$.fn.aalert = function (method) {
|
||||||
if (methods[method]) {
|
if (methods[method]) {
|
||||||
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
||||||
} else {
|
|
||||||
$.error('Method ' + method + ' does not exist');
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$.error('Method ' + method + ' does not exist');
|
||||||
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
var methods = {
|
var methods = {
|
||||||
|
|
||||||
changeTo(valiant) {
|
changeTo(valiant) {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
|
|
||||||
|
|
@ -58,9 +60,9 @@
|
||||||
$this.hide();
|
$this.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $this.hasClass('remove')) {
|
if ($this.hasClass('remove')) {
|
||||||
$this.remove();
|
$this.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
@ -69,7 +71,7 @@
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
if ($this.hasClass('fade')) {
|
if ($this.hasClass('fade')) {
|
||||||
$this.fadeIn();
|
$this.fadeIn();
|
||||||
} else if ( $this.hasClass('slide')) {
|
} else if ($this.hasClass('slide')) {
|
||||||
$this.slideDown();
|
$this.slideDown();
|
||||||
} else {
|
} else {
|
||||||
$this.show();
|
$this.show();
|
||||||
|
|
@ -90,7 +92,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
$('.alert [data-dismiss="aalert"]').click(e => {
|
$('.alert [data-dismiss="aalert"]').click(e => {
|
||||||
$element = $(e.target).closest('.alert');
|
var $element = $(e.target).closest('.alert');
|
||||||
methods.close.apply($element);
|
methods.close.apply($element);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -98,4 +100,4 @@
|
||||||
methods.closeAfter.apply(element, [$(element).data('timeout')]);
|
methods.closeAfter.apply(element, [$(element).data('timeout')]);
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue