Extend LinkView to allow click tracking.
Allows us to hook in to certain links and see how they're used.
This commit is contained in:
parent
80b3c2c826
commit
3b2e8d69f3
|
@ -149,6 +149,16 @@ Travis.FormSettingsView = Ember.View.extend Ember.TargetActionSupport,
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
@triggerAction()
|
@triggerAction()
|
||||||
|
|
||||||
|
Ember.LinkView.reopen
|
||||||
|
init: ->
|
||||||
|
@_super()
|
||||||
|
eventName = Ember.get(this, 'eventName')
|
||||||
|
if Ember.get(this, 'trackEvent')
|
||||||
|
@on(eventName, this, @_trackEvent)
|
||||||
|
@on(eventName, this, @_invoke)
|
||||||
|
|
||||||
|
_trackEvent: (event) ->
|
||||||
|
event.preventDefault()
|
||||||
|
|
||||||
Ember.Handlebars.registerHelper('settings-form', (path, options) ->
|
Ember.Handlebars.registerHelper('settings-form', (path, options) ->
|
||||||
if arguments.length == 1
|
if arguments.length == 1
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="tab_new" {{bind-attr class="view.classNew"}}>
|
<li id="tab_new" {{bind-attr class="view.classNew"}}>
|
||||||
<h5>{{#link-to "profile.index" title="Add New Repository"}}+{{/link-to}}</h5>
|
<h5>{{#link-to "profile.index" trackEvent="add-repository-from-list" title="Add New Repository"}}+{{/link-to}}</h5>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user