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.

Custom class injections

See original GitHub issue

Hi,

Very nice and useful plugin! In the project I am using the plugin, I have the case to call the modal a couple of times to confirm user actions. One of the dialogs is to confirm delete and another one is to save. So to have difference for confirmations I am overriding button colors (red on delete, green on save). The problem in this is that I have to inject different classes for styling (or <style> element inside the dialog initialization). Would you consider adding some custom class name injections in dialog initialization?

For example:

let options = {
    html: false,
    loader: false,
    reverse: false, 
    okText: 'Continue',
    cancelText: 'Close',
    customClass: 'remove-class'
};

and remove-class will be injected to the div.dg-main-content, so we could override all other css thru this custom class. Just as an example, to have another solution like this would be nice 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Godofbrowsercommented, Mar 14, 2018

You’re welcome @elibolonur 😃

1reaction
Godofbrowsercommented, Mar 14, 2018

@hjortzen that’s equally a very good idea. But would mean too much configuration whereas a single css class can handle this and more.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dependency Injection in Custom Class - .NET Core
Dependency injection is a programming technique that makes a class independent of its dependencies. It achieves that by decoupling the usage of ...
Read more >
Custom Classes and Dependency Injection
Using dependency injection with services is fairly straightforward and common place, ... Below is an example custom class that implements ...
Read more >
Type Hinting and Method Injection in a Custom Class
I want to inject a custom class into the method of another class. ... <?php namespace App; class Rabbit { //The class to...
Read more >
How do I instantiate a custom class with dependency injection?
A class implementing ContainerInjectionInterface is instantiated by calling the factory method create().
Read more >
Is Dependency Injection Into a Custom Exception a Good Idea?
Investigating whether dependency injection into a custom Exception class a good idea. Published on 24 August 2021. C# · Code · Thoughts ...
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