From d1792a616b60acd7913d4d6303a303a4dd718398 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 3 Nov 2014 23:46:03 +0000 Subject: [PATCH] jquery.getAttrs: Remove compat code for IE6/IE7 These browsers are given a javascriptless environment as of MediaWiki 1.24, so these fixes are obsolete. Change-Id: I4174c87abfa68fea7a2efce5c3cccd9dfba12922 --- resources/src/jquery/jquery.getAttrs.js | 27 +++++++------------------ 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/resources/src/jquery/jquery.getAttrs.js b/resources/src/jquery/jquery.getAttrs.js index c44831c404..5ad76480cd 100644 --- a/resources/src/jquery/jquery.getAttrs.js +++ b/resources/src/jquery/jquery.getAttrs.js @@ -5,32 +5,19 @@ /** * Get the attributes of an element directy as a plain object. * - * If there are more elements in the collection, like most jQuery get/read methods, - * this method will use the first element in the collection. + * If there is more than one element in the collection, similar to most other jQuery getter methods, + * this will use the first element in the collection. * - * In IE6, the `attributes` map of a node includes *all* allowed attributes - * for an element (including those not set). Those will have values like - * `undefined`, `null`, `0`, `false`, `""` or `"inherit"`. - * - * However there may be attributes genuinely set to one of those values, and there - * is no way to distinguish between attributes set to that and those not set and - * it being the default. If you need them, set `all` to `true`. They are filtered out - * by default. - * - * @param {boolean} [all=false] * @return {Object} */ -jQuery.fn.getAttrs = function ( all ) { - var map = this[0].attributes, +jQuery.fn.getAttrs = function () { + var i, + map = this[0].attributes, attrs = {}, - len = map.length, - i, v; + len = map.length; for ( i = 0; i < len; i++ ) { - v = map[i].nodeValue; - if ( all || ( v && v !== 'inherit' ) ) { - attrs[ map[i].nodeName ] = v; - } + attrs[ map[i].nodeName ] = map[i].nodeValue; } return attrs; -- 2.20.1