Created
February 9, 2012 17:40
-
-
Save jacob414/1781484 to your computer and use it in GitHub Desktop.
Pico jQuery faking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Doesn't work yet, have patience.. | |
fakeJqOb = new class FakeJqOb | |
constructor: (@els=[]) -> | |
append: (content) => | |
@ap or= [] | |
console.log "Adding #{content}" | |
@ap.push content | |
@ | |
fakeJqOb.els['#an-id'] = new FakeJqOb() | |
fakeJq = (sel) -> | |
if fakeJqOb[sel]? | |
console.log 'add to el..' | |
fakeJqOb[sel] | |
else | |
fakeJqOb | |
el = fakeJq('#an-id').append('x').append('y') | |
console.log 'global', fakeJqOb | |
console.log 'el', el |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment