• Resolved moxymore

    (@moxymore)


    Hi again,

    I have a question in which nor the documentation nor google can answer yet. I just wish to know if there is a way to modify alert box designs generated by cmb2?

    Browser inspector’s can’t give me enough information to specify the target. Have you some information about it? Or maybe a way to generate our own alert box output maybe?

    This is not ultra important, but it can help the user friendliness if everything is design properly.

    Regards.

    • This topic was modified 6 years, 1 month ago by moxymore.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hey @moxymore I’m not quite sure what alerts you’re referring to. Is this something you’re finding triggered/displayed via a specific field type?

    I’m curious if the alerts are either provided by your browser or possibly jQueryUI moments.

    Thread Starter moxymore

    (@moxymore)

    I’m speaking of the alerts generated by your parameters for group fields (repeater) : `[option] : array(
    ‘remove_confirm’ : esc_html__( ‘Are you sure you want to remove this item?’, ‘gia’ )
    )`

    Alerts box are generated each time I want to delete an item of a repeater. I expected to tweak the design a bit, cause the generated one is very very very generic ??

    PS : what a shame, WordPress doesn’t allow me to put = and > in a code bloc, he sanitizes it and break the initial display.

    • This reply was modified 6 years, 1 month ago by moxymore.
    • This reply was modified 6 years, 1 month ago by moxymore.
    • This reply was modified 6 years, 1 month ago by moxymore.
    • This reply was modified 6 years, 1 month ago by moxymore.
    • This reply was modified 6 years, 1 month ago by moxymore.
    • This reply was modified 6 years, 1 month ago by moxymore.
    • This reply was modified 6 years, 1 month ago by moxymore.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    If you’re looking for github-style code blocks, meaning 3 `’s in a row, it’s a little different and just a single ` here.

    Regarding the rest, aha, I was able to track things down.

    That is all powered by https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm and window.confirm() which is going to be very basic and not styleable from everything I’ve ever seen about it.

    Unless we went for some sort of fancier solution for confirming desire to delete, we’re just stuck with this.

    Thread Starter moxymore

    (@moxymore)

    Allright, it seems that I have to do some sort of custom jQuery to do this. Like said previously, I never code in JS but this sounds not very complicated.

    What I’ll try is :
    1 – Désactivate the ‘remove_confirm’ option of the cmb2 repeater.
    2 – Append an HTML div to the form, which will have a negative margin (or opacity:0) and which will be displayed on.click() by JS
    3 – Append a click.to.action on the specified divs (the cross of my repeater, and the custom “delete item” at the end of each item.

    Another challenge here, but i’ll be able to do it. I worked hard yesterday to make a little function which conditionnally display fields (a kind of “show advanced parameters” which works in a repeater) and I had success. So why not continuing this JS/jQuery lesson further :p

    Thank you again.

    • This reply was modified 6 years, 1 month ago by moxymore.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    welcome, and yeah, at this point anything done here is going to end up being a custom solution, unless I’m somehow mistaken.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Alert box: any way to modify its style?’ is closed to new replies.