Created
June 29, 2012 05:53
-
-
Save elsassph/3016097 to your computer and use it in GitHub Desktop.
jQuery shorthand for haxe 'using'
This file contains 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
class JQ | |
{ | |
static public inline function select(j:js.Dom.HtmlDom):js.JQuery | |
{ | |
return new js.JQuery(j); | |
} | |
static public inline function query(j:String):js.JQuery | |
{ | |
return new js.JQuery(j); | |
} | |
} |
This file contains 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
// imports | |
using JQ; | |
// usage | |
"#foo .bar".query().fadeIn(); | |
Lib.document.body.select().addClass("baz"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment