Socket
Socket
Sign inDemoInstall

backbone.mousetrap

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    backbone.mousetrap

backbone.mousetrap ==================


Version published
Weekly downloads
7
increased by75%
Maintainers
1
Install size
3.41 kB
Created
Weekly downloads
 

Readme

Source

backbone.mousetrap

Bring Backbone.js and Mousetrap together nicely for declarative keyboard event bindings on Backbone views.

  • Nice declarative syntax
  • Allows you to bind different keyboard events to different views
  • Keyboard events are unbound automatically when the view's remove() is called
var View = Backbone.View.extend({
    keyboardEvents: {
        'command+shift+t': 'test',
        'control+shift+t': 'test'
    },

    test: function(ev) {
        alert('hello world!');
    }
});

MIT LICENSE


Thanks to our friends at Codecademy for showing us the declarative light with backbone.declarative.

FAQs

Last updated on 17 Feb 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc