Created
December 13, 2013 11:45
-
-
Save supasympa/7943159 to your computer and use it in GitHub Desktop.
click proxy for backbone
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
//<a href="#/my/application/route" rel="" data-forproxy="{myproxy:data}">Some link</a> | |
var someView = { | |
events : { | |
'click a[rel="proxy"]' : clickProxy | |
}, | |
clickProxy : function(e){ | |
var $anc, proxyData, route; | |
$anc = $(e.target()); | |
proxyData = $anc.attr('data-forproxy'); | |
route = $anc.attr('href').replace('#',''); | |
app.route(route, {trigger:true}); | |
return; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment