Single click selects the invite link

- Earlier, triple-clicking or drag & select had to be performed to select
- Should consider a copy button

Moving away from the inline onClick handler

It didn't feel right to be writing js in a helper.

Refactoring setupInviteLinks into a sidebar Backbone View
This commit is contained in:
Srihari Sriraman 2013-08-27 10:18:50 +05:30 committed by Jonne Haß
parent ec97c2e760
commit cbaaf86bae
2 changed files with 12 additions and 0 deletions

View file

@ -100,6 +100,7 @@ var app = {
setupGlobalViews: function() { setupGlobalViews: function() {
app.hovercard = new app.views.Hovercard(); app.hovercard = new app.views.Hovercard();
app.aspectMemberships = new app.views.AspectMembership(); app.aspectMemberships = new app.views.AspectMembership();
app.sidebar = new app.views.Sidebar();
}, },
/* mixpanel wrapper function */ /* mixpanel wrapper function */

View file

@ -0,0 +1,11 @@
app.views.Sidebar = app.views.Base.extend({
el: '.rightBar',
events: {
'click input#invite_code': 'selectInputText'
},
selectInputText: function(event) {
event.target.select();
}
});