dobarkod / cookie-banner

JavaScript based cookie-info banner for complying with EU cookie law
MIT License
425 stars 85 forks source link

add option closePrecedes to allow close text to follow the message fo… #59

Closed clarkewd closed 6 years ago

clarkewd commented 6 years ago

Allow an option to have the close text follow the cookie message. An example usage would be:

<script data-close-precedes="false"
        data-close-text="I got it."
        data-close-style="display:inline;text-decoration:underline;"
        data-linkmsg=" "
        ...
zytzagoo commented 6 years ago

Hi and thanks for the contribution!

It looks like this is done to help with some styling requirements?

Can you provide an example why it would be needed exactly (and how/why it couldn't be achieved by adding some custom css and/or inline styles via existing options? http://tanalin.com/en/articles/css-block-order/ has some examples on how to reorder elements using css...)

clarkewd commented 6 years ago

Yes it is possible with CSS but one of the wonderful things about this script is that it can be so nicely configured just by using the data attributes.

Without this proposed option is it possible to configure the banner to look like this with only data attributes?

screen region 2017-10-24 at 12 16 13

zytzagoo commented 6 years ago

I managed to get something quickly, but it's not ideal, I agree: https://jsfiddle.net/uf8he3xr/

If we're to proceed with your proposed change, would you be willing to add the README change (new option description) and perhaps even a test or two? (not a hard requirement for merge, just so that I know to plan some time to do it myself then, and prep a new release etc.)

zytzagoo commented 6 years ago

Turned things around a bit, but you should now be able to do what you wanted.

Will tag/release 1.2.1 shortly.

clarkewd commented 6 years ago

thanks so much!