Created
June 30, 2012 14:03
-
-
Save kosmikko/3023870 to your computer and use it in GitHub Desktop.
Provides common extensions to Chaplin views to be used as a mixin
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
| define [ | |
| 'chaplin' | |
| 'Handlebars' | |
| ], (Chaplin, Handlebars) -> | |
| 'use strict' | |
| BaseExtensions = | |
| trackAction: (category, action, label, value) -> | |
| # track user action with Google Analytics | |
| # label and value are optional | |
| if _gaq? | |
| arr = ['_trackEvent', category, action] | |
| if label and value | |
| arr.push label + ':' + value | |
| _gaq.push(arr) | |
| ### | |
| More functions & properties... | |
| ### | |
| BaseExtensions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment