Skip to content
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

More than 1 datepicker field results in multiple CSS and JS #5

Open
benr77 opened this issue Jun 4, 2014 · 2 comments
Open

More than 1 datepicker field results in multiple CSS and JS #5

benr77 opened this issue Jun 4, 2014 · 2 comments

Comments

@benr77
Copy link

benr77 commented Jun 4, 2014

I have a form with 6 different date fields. I assign the datepicker to each field, and they all work correctly.

However, where I place {{ form_stylesheet(edit_form) }} in my Twig template results in a tag to the same CSS file 6 times (i.e. the number of datepicker fields on my form.

The same is true for the JS - it adds a SCRIPT tag for each datepicker field.
Surely these files should only be included once?

@waltercruz
Copy link
Contributor

any news on this?

@waltercruz
Copy link
Contributor

I included the js in my main template like this:

{% javascripts
'bundles/scdatetimepicker/js/bootstrap-datetimepicker.min.js'
%}

<script type="text/javascript" src="{{ asset_url }}"></script>

{% endjavascripts %}

and tried to override the jquery_layout.html.twig, but the bundle is not reading my jquery_layout.html.twig :(

fogs pushed a commit to SoftwareBetrieb/DatetimepickerBundle that referenced this issue Jan 24, 2017
…collot#20

Changed div_layout.html.twig to contain all options as data-* attributes
in the single_text form field. This allows initialization of
datetimepicker without option in JS and you can have several fields in
one form. Both form_javascript(form) and form_stylesheet(form) are not
needed any more (see README for details)
fogs pushed a commit to SoftwareBetrieb/DatetimepickerBundle that referenced this issue Jan 24, 2017
…collot#20

Changed div_layout.html.twig to contain all options as data-* attributes
in the single_text form field. This allows initialization of
datetimepicker without option in JS and you can have several fields in
one form. Both form_javascript(form) and form_stylesheet(form) are not
needed any more (see README for details)
fogs pushed a commit to SoftwareBetrieb/DatetimepickerBundle that referenced this issue Apr 29, 2018
…collot#20

Changed div_layout.html.twig to contain all options as data-* attributes
in the single_text form field. This allows initialization of
datetimepicker without option in JS and you can have several fields in
one form. Both form_javascript(form) and form_stylesheet(form) are not
needed any more (see README for details)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants