Code Monkey home page Code Monkey logo

ember-keyboard-shortcuts's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-keyboard-shortcuts's Issues

Why is this not published to npm?

How come we have to install this via github? Seems a npm install --save ember-keyboard-shortcuts would be easier and you can search npmjs.com for it with the ember-addon keyword or via http://www.emberaddons.com/

Please consider publishing to NPM (npm publish). Thanks.

Cannot read property 'bind' of undefined in latest 1.0.1 version

I recently tried to upgrade from 0.3.0 to version 1.0.1 to get rid of the event storms that caused me trouble.

However it stopped working when using keyboardShortcuts on a route. I get the error Cannot read property 'bind' of undefined.

It seems as mousetrap is not defined when reaching mousetrap.bind inside the invokeAction method in create-mixin.js. The error is simple to reproduce with the following simple shortcut to an action set:

keyboardShortcuts: {
    'esc': 'cancel'
}

I can see that mousetrap is not initialized on declaration as it was before. Since my actionObject is global, not scoped and does not have a targetElement it will not get into any of the if statements where mousetrap is set.

Trigger an action on key sequence

First, thank you for developing this awesome plugin ๐Ÿ™‚

One thing I'd like to do is be able to use a sequence of keys to trigger an action. Similar to what can be done in vim.

E.g. Pressing g twice in short-succession to trigger an action.

Is this possible?

Migrate to Typescript

It makes sense to migrate to Typescript to improve interop with users of Typescript.

Release master version

Hi, can you please create a 0.4.0 release for the master branch please?

Thanks in advance!

Maintaining the library

@trym great addon. are you planning on maintaining it going forward? I noticed there are some longstanding PRs and Mousetrap is now at 1.5.3.

If you don't have the time, I'd be more than happy to help maintain it if you add me as a contributor. If not, I'll probably go ahead and just maintain my own fork.

Thanks!

DOM node ( memory ) leak

to clear event listener we are using mousetrap._handleKeyEvent which is actually not defined ( it is private to the library ).

so basically, when assigning on a component, we will be leaking DOM nodes because of that.

The only way I can see to do that is to clone moustrap somewhere, add a function to cleanup ( moving the cleanup code from this addon to mousetrap ), create a PR and wait for it to be accepeted.

In the mean time, we can use the cloned moustrap to fix this issue.

Blacklist Elements

Hey great job making mousetrap ember friendly ๐Ÿ˜„

When a shortcut is scoped to a component, can we have a blacklist class names under which it won't fire.

For example, let's say there is a post component which has 2 content editable's, one for writing post and other for previewing posts. I don't want the shortcuts that is working for the first content editable working when the user is inside the preview content editable. Here, global attribute for shortcuts is set to true so as to make shortcuts work inside a content editable.

In this case, I can blacklist the preview content editable's class post-preview, so that the shortcut triggers inside all post component but not inside preview content editable.

README.md could use example for Controllers

The README says keyboard shortcuts can be used on Routes, Controllers and Components, but only gives examples for Routes and Components. (I'm new to Ember and so only vaguely aware of the controllers-will-be-deprecated message, if that's the reason.)

I think the Controller equivalent is to call bindKeyboardShortcuts() inside the init() hook.

Routing via component

Hi,

Is there anyway to re-route within the component instead of via a route?
What is then the point to add the keyboard shortcuts to the component if we still need to also add the functions in the route? Unless I'm missing something? I don't want to have to repeat my "actions" in each route. I'd like to contain all of this in my component. Is it possible?

Thank you!

Ember 2.x

Hello! Cool addon but is it working with ember and ember-data 2.x?

Binding and unbinding shortcuts in route

hi ..I was just tried to use this addon in my application route and tried to bind and unbind shortcuts depending on one boolean value that has been set to false initially in one service file..
The value of that boolean in that service will toogle to false and true based on some actions.
I haven't used the hooks namely activate and deactivate because it is my application route so the deactivate hook will not trigger in there.I simply used methods bindKeyboardShortcuts, unbindKeyboardShortcuts .But when I tried to do this I'm getting some errors.
error1
errror
My application:

applicationRoute.txt

In this file when I click on t it should call action "sayHello" which is in my test-mixin which will simply alert"hello".
why the above mentioned errors are occuring.?
It will be better if the shortcuts can be handled only by those bindKeyboardShortcuts, unbindKeyboardShortcuts methods and not by the activate and deactivate hooks.because the developer knows when to unbind and bind nevertheless he gets to another route or he stays in the same route.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.