You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
520 B
25 lines
520 B
function htmlRemove() { |
|
this.innerHTML = ""; |
|
} |
|
|
|
function htmlConstant(value) { |
|
return function() { |
|
this.innerHTML = value; |
|
}; |
|
} |
|
|
|
function htmlFunction(value) { |
|
return function() { |
|
var v = value.apply(this, arguments); |
|
this.innerHTML = v == null ? "" : v; |
|
}; |
|
} |
|
|
|
export default function(value) { |
|
return arguments.length |
|
? this.each(value == null |
|
? htmlRemove : (typeof value === "function" |
|
? htmlFunction |
|
: htmlConstant)(value)) |
|
: this.node().innerHTML; |
|
}
|
|
|