question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feedback] more customization options and split modules

See original GitHub issue

Hi there! Just recently discovered this very cool utility! Thanks a lot for making it first of all!

I’m using 0.7.2 and I have a few comments/feedback/requests for the next version

It seems the closed: true parameter doesn’t work. Whether I set the option to closed true or false the controls are always visible.

Doing gui.close() immediately does however work around this problem.

I would really like it if there was a gui.hide() as well (for when hideable is enabled).

I’ve tried to set it manually by doing this

gui.domElement.style.display = 'none';

which does work, but then I have to press the ‘h’ key twice to make it appear because I can’t set the internal ‘hide’ variable to false

So perhaps a ‘hidden’ parameter as well as an exposed hide() toggle method would be very useful

I would also love to be able to customize the key used to hide, currently hardcoded to ‘h’ (72)

I would also love to be able to change the text ‘open controls’ and ‘close controls’

I also noticed that setting the width as an option does work as far as shortening the controls. However for some reason the text elements inside the controls do not respect this width. I’ve attached a screenshot to show what I mean

This is with the width set to 100. The control elements are “functions” so the only thing that is showing is the label itself. You should be easily able to read the word “short” but it is cut off even though it easily fits in 100px

screenshot 2018-05-23 18 24 40

Lastly, it would be nice if there was a “core” version of this package that didn’t include things like the colorPicker and other modules that are making this library be 50kb minified. It would be nice if those modules were separated so the library size could be reduced. 50kb minified is not exactly lightweight… think it could be a lot lighter for those of us who just want to use the library to trigger functions for example

Here’s to hoping some of this can make it into 0.7.3 😃

Thanks!!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vesper8commented, Feb 22, 2019

I’ve resorted to disabling the ‘hideable’ flag and implementing by own jquery display toggle and the KeyPress library to implement the same letter ‘h’ but with more control as to when it gets fired… here’s my code:

import Keypress from 'keypress.js';
...
const listener = new Keypress.Listener();

listener.simple_combo('h', () => {
if (($('input').is(':focus') || $('textarea').is(':focus'))) {
  return true;
}
$('.dg.ac').toggle();
});

works perfectly

thanks for the quick reply!

I guess adding ‘textarea’ to that code of yours would also do the trick

0reactions
donmccurdycommented, Feb 22, 2019

…it seems there still isn’t a built-in way to allow the use of the “h” hotkey while not triggering it while the user is for example typing in a form text field or textarea…

Note that there is code already in place that attempts to prevent the shortcut firing when a text input is focused. If there’s a simple way to make that more robust (e.g. checking for <textarea/> elements as well) a PR would be welcome. A PR adding the option to simply disable the shortcut entirely would also be great. Unfortunately I do not have time to implement those myself, or a workaround in the meantime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Request for feedback: replace conditional split with partial split.
conProblem/Motivation For [#3170204] we need to have "partial splits" which track the changes to config that depends on the module we split ......
Read more >
Structure and customize template layouts - Knowledge Base
Learn how to set up and customize your existing drag and drop template, and work with modules, groups, and columns as the building...
Read more >
A review of multiple site architecture options in Drupal
Some degree of customization is possible, because each site has its own configuration, and it can have it's own custom theme and modules. ......
Read more >
Overview of Play Feature Delivery | Android Developers
A unique benefit of feature modules is the ability to customize how and when different features of your app are downloaded onto devices...
Read more >
Model split - Finance & Operations | Dynamics 365
Developing modular code is the driving force behind the model split. Splitting the stack into multiple models provides many benefits, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found