Revert "Use a more precise check for "baseVal" property."

This reverts commit 94d0e1aa18.
This commit is contained in:
Jason Davies 2011-05-05 16:20:54 +01:00
Родитель 94d0e1aa18
Коммит 2280d51c9d
3 изменённых файлов: 8 добавлений и 14 удалений

9
d3.js поставляемый
Просмотреть файл

@ -1307,8 +1307,7 @@ function d3_selection(groups) {
return first(function() {
if ("classList" in this) return this.classList.contains(name);
re.lastIndex = 0;
return re.test(typeof this.className === "object" &&
"baseVal" in this.className
return re.test(this.className.baseVal != null
? this.className.baseVal : this.className);
});
}
@ -1316,8 +1315,7 @@ function d3_selection(groups) {
/** @this {Element} */
function classedAdd() {
if ("classList" in this) return this.classList.add(name);
var isAnimatedString = typeof this.className === "object" &&
"baseVal" in this.className,
var isAnimatedString = this.className.baseVal != null,
classes = isAnimatedString ? this.className.baseVal : this.className;
re.lastIndex = 0;
if (!re.test(classes)) {
@ -1330,8 +1328,7 @@ function d3_selection(groups) {
/** @this {Element} */
function classedRemove() {
if ("classList" in this) return this.classList.remove(name);
var isAnimatedString = typeof this.className === "object" &&
"baseVal" in this.className,
var isAnimatedString = this.className.baseVal != null,
classes = isAnimatedString ? this.className.baseVal : this.className;
classes = d3_collapse(classes.replace(re, " "));
if (isAnimatedString) this.className.baseVal = classes;

4
d3.min.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -307,8 +307,7 @@ function d3_selection(groups) {
return first(function() {
if ("classList" in this) return this.classList.contains(name);
re.lastIndex = 0;
return re.test(typeof this.className === "object" &&
"baseVal" in this.className
return re.test(this.className.baseVal != null
? this.className.baseVal : this.className);
});
}
@ -316,8 +315,7 @@ function d3_selection(groups) {
/** @this {Element} */
function classedAdd() {
if ("classList" in this) return this.classList.add(name);
var isAnimatedString = typeof this.className === "object" &&
"baseVal" in this.className,
var isAnimatedString = this.className.baseVal != null,
classes = isAnimatedString ? this.className.baseVal : this.className;
re.lastIndex = 0;
if (!re.test(classes)) {
@ -330,8 +328,7 @@ function d3_selection(groups) {
/** @this {Element} */
function classedRemove() {
if ("classList" in this) return this.classList.remove(name);
var isAnimatedString = typeof this.className === "object" &&
"baseVal" in this.className,
var isAnimatedString = this.className.baseVal != null,
classes = isAnimatedString ? this.className.baseVal : this.className;
classes = d3_collapse(classes.replace(re, " "));
if (isAnimatedString) this.className.baseVal = classes;