-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Working on using actions for menu. #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Pinging @sccolbert and @dwillmer on this. Chris and David - here is the work Matthias has been doing to start to use the existing action system in our menus. |
|
Note, this is a rewriting from scratch of ipython/ipython#7285 |
|
👍 to this. I like using the actions stuff (except the help-index part). I'm happy to rebase #400 on this one after I test it a bit. |
94f09bf to
a708522
Compare
|
Rebased, not tested. |
a708522 to
6065d1b
Compare
|
Manually tested, seem to work. Ping @minrk who worked on these file recently |
6065d1b to
21242b7
Compare
|
Rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, had to lookup IIFE acronym - also, probably don't want "F-you" in the comment, even though I totally agree, it's super annoying!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wha't the problem with Frickin-you Javascript ?
|
I noticed you left a few of the menu things as non-actions. Would you want to go ahead and convert them all to actions in this PR? Or in a later PR? |
Later PR easier to test manually in an exaustive manner at every rebase. |
102f874 to
650dfb5
Compare
And deprecate private, unused thing.
59a3048 to
c2fc31a
Compare
|
Rebased once more. @jdfreder ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now pass event in here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for-in always needs Object.hasOwnProperty because js is the best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think Object.keys(id_actions_dict) works, too.
|
This is looking great, after you address Min's comments - I think this is good to go! |
42a9eb7 to
6edc680
Compare
|
Done: - for(var idx in id_actions_dict){
+ var keys = Object.keys(id_actions_dict);
+ for(var i in keys){
+ var idx = keys[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. for(...in) is just never safe. It might as well not exist. You have to use
Object.keys(obj).map(function (key) {...});or filter on obj.hasOwnProperty(key).
6edc680 to
552a5a0
Compare
for(var idx in id_actions_dict){
+ if (!id_actions_dict.hasOwnProperty(idx)){
+ continue;
+ }
var id_act = id_actions_dict[idx];Better ? |
Working on using actions for menu.
|
@Carreau yup. I apologize on behalf of Javascript. |
No need to. Thanks ! |
|
Changes Unknown when pulling 552a5a0 on Carreau:action-menu into ** on jupyter:master**. |
Mostly for now to be sure that for all menu item there is
a corresponding action.
So that some menu actions are available from command palette.
We can work on auto-generating menus after.
Note to myself. AVAILABLE ONLY HAVE ONE L, get that in your head.