|
Last change
on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
528 bytes
|
| Line | |
|---|
| 1 | function textRemove() {
|
|---|
| 2 | this.textContent = "";
|
|---|
| 3 | }
|
|---|
| 4 |
|
|---|
| 5 | function textConstant(value) {
|
|---|
| 6 | return function() {
|
|---|
| 7 | this.textContent = value;
|
|---|
| 8 | };
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | function textFunction(value) {
|
|---|
| 12 | return function() {
|
|---|
| 13 | var v = value.apply(this, arguments);
|
|---|
| 14 | this.textContent = v == null ? "" : v;
|
|---|
| 15 | };
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | export default function(value) {
|
|---|
| 19 | return arguments.length
|
|---|
| 20 | ? this.each(value == null
|
|---|
| 21 | ? textRemove : (typeof value === "function"
|
|---|
| 22 | ? textFunction
|
|---|
| 23 | : textConstant)(value))
|
|---|
| 24 | : this.node().textContent;
|
|---|
| 25 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.