|
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:
476 bytes
|
| Line | |
|---|
| 1 | import {tweenValue} from "./tween.js";
|
|---|
| 2 |
|
|---|
| 3 | function textConstant(value) {
|
|---|
| 4 | return function() {
|
|---|
| 5 | this.textContent = value;
|
|---|
| 6 | };
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | function textFunction(value) {
|
|---|
| 10 | return function() {
|
|---|
| 11 | var value1 = value(this);
|
|---|
| 12 | this.textContent = value1 == null ? "" : value1;
|
|---|
| 13 | };
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | export default function(value) {
|
|---|
| 17 | return this.tween("text", typeof value === "function"
|
|---|
| 18 | ? textFunction(tweenValue(this, "text", value))
|
|---|
| 19 | : textConstant(value == null ? "" : value + ""));
|
|---|
| 20 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.