|
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:
474 bytes
|
| Line | |
|---|
| 1 | import creator from "../creator.js";
|
|---|
| 2 | import selector from "../selector.js";
|
|---|
| 3 |
|
|---|
| 4 | function constantNull() {
|
|---|
| 5 | return null;
|
|---|
| 6 | }
|
|---|
| 7 |
|
|---|
| 8 | export default function(name, before) {
|
|---|
| 9 | var create = typeof name === "function" ? name : creator(name),
|
|---|
| 10 | select = before == null ? constantNull : typeof before === "function" ? before : selector(before);
|
|---|
| 11 | return this.select(function() {
|
|---|
| 12 | return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);
|
|---|
| 13 | });
|
|---|
| 14 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.