mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
js/helpers: add $.hasAttr
Need this for another fix and there is no such jQuery function. As this seems to also be inconsistant across browsers I thought this would definitively be worth a custom jQuery plugin.
This commit is contained in:
parent
0d3fb9e7a5
commit
9ce99bf280
@ -95,6 +95,13 @@ if (!Function.prototype.bind) {
|
||||
|
||||
'use strict';
|
||||
|
||||
/* Whether a HTML tag has a specific attribute */
|
||||
$.fn.hasAttr = function(name) {
|
||||
// We have inconsistent behaviour across browsers (false VS undef)
|
||||
var val = this.attr(name);
|
||||
return typeof val !== 'undefined' && val !== false;
|
||||
};
|
||||
|
||||
/* Get class list */
|
||||
$.fn.classes = function (callback) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user