| 729 | return this.each(d3_selection_style(name, value, priority)); |
| 730 | }; |
| 731 | function d3_selection_style(name, value, priority) { |
| 732 | function styleNull() { |
| 733 | this.style.removeProperty(name); |
| 734 | } |
| 735 | function styleConstant() { |
| 736 | this.style.setProperty(name, value, priority); |
| 737 | } |
| 738 | function styleFunction() { |
| 739 | var x = value.apply(this, arguments); |
| 740 | if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority); |
| 741 | } |
| 742 | return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant; |
| 743 | } |
| 744 | d3_selectionPrototype.property = function(name, value) { |
| 745 | if (arguments.length < 2) { |
| 746 | if (typeof name === "string") return this.node()[name]; |