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