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

last item move buttons (after adding and removing new item) #147

Open
ghost opened this issue Apr 17, 2019 · 4 comments
Open

last item move buttons (after adding and removing new item) #147

ghost opened this issue Apr 17, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 17, 2019

First of all, thanks for this great job.
It looks as if there's a problem with move buttons of the last item, after adding and removing an item :

At page loading, ok (sorry screenshots take some place, but this is my use case) :

Screenshot1

After inserting an item, ok :

Screenshot2

After removing inserted item, there's something wrong :

Screenshot3

Here's the twig part :

<div class="form-group row">
    {{ form_label(form.workImages) }}{# #}
    <div class="col-sm-7">
        <div id="{{ form.workImages.vars.id }}" data-prototype="{{ form_row(form.workImages.vars.prototype)|e('html_attr') }}" class="card work-images" data-prototype-name="{{ form.workImages.vars.prototype.vars.name }}" data-name-prefix="{{ form.workImages.vars.full_name }}">
            <div class="card-body">
                <div class="entries">
{% for workImage in form.workImages %}
                    {{ form_row(workImage) }}
{% endfor %}
                </div>
                <div class="text-right mt-1">
                    {{ form_widget(form.addImage, { attr: { 'data-collection': form.workImages.vars.id, class: 'collection-action collection-add btn-primary' } }) }}
                </div>
            </div>
        </div>
    </div>
</div>

Javascript part :

$('.work-images').collection({
        elements_selector: '> .card-body > .entries > div',
        position_field_selector: '.position',
        add_at_the_end: true,
        custom_add_location: true,
        elements_parent_selector: '%id% > .card-body > .entries'
    });

Is it a bug or am I doing something wrong?

@ghost
Copy link
Author

ghost commented Apr 17, 2019

ah ok iam an idiot and/or the project is dead. Closed.

@ghost ghost closed this as completed Apr 17, 2019
@ninsuo
Copy link
Owner

ninsuo commented Apr 17, 2019

Hey mate,

@ninsuo ninsuo reopened this Apr 17, 2019
@ninsuo
Copy link
Owner

ninsuo commented Apr 17, 2019

The project is not dead but the project is not alive either. If you are not throwing anything i wont do anything right away. Please put a PR or you will wait a while

@ghost
Copy link
Author

ghost commented Apr 18, 2019

Ok, sorry for my last answer. Nobody seems to have noticed that the move buttons should return as a "move up" button for the last item, so I wondered first if something was wrong on my side.
I will try to investigate a little bit more if I have time.

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

1 participant