Created
January 18, 2012 19:28
-
-
Save tal/1635047 to your computer and use it in GitHub Desktop.
Changing the way to define classes in js
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
GC.util.classSetup('GC.Page.Klass', function() { | |
return { | |
val1: val1, | |
val2: val2 | |
} | |
}); |
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
GC || (GC = {}); | |
GC.Page || (GC.Page = {}); | |
GC.Page.Klass = (function() { | |
return { | |
val1: val1, | |
val2: val2 | |
} | |
})(); |
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
GC.util.classSetup('GC.Page', function() { | |
return { | |
val1: val1 | |
} | |
}); | |
// Will safely create or merge with existing GC.Page |
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
GC || (GC = {}); | |
GC.Page = (function() { | |
return { | |
val1: val1 | |
} | |
})(); | |
// Will override must be run before klass.old.js or shit will get overridden |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment