Skip to content

changes to container location and new item tabParent #1

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

StephenNeate
Copy link

Ok lets see if this works better. Detailed notes on the main update are...

Changed location of tabContainer.html(data) so that content exists prior to callbackFn for better binding.

Added in tabParent as the parent of all tab panels to enable a an empty request on change (lines 130-132). Both the tabParent value needs to exist and on each container the class remove-rd so that the remove action is intentional, especially given this is undesirable in the case where the tab doesn't need to be refreshed.

The point of that was to solve the issue of binding events to hidden tab content.

If the tabParent item is not what you want to see at all, I can fork that out as the change in location of tabContainer.html(data) will be essential for some users.

Changed location of tabContainer.html(data) so that content exists prior to callbackFn for better binding.

Added in tabParent as the parent of all tab panels to enable a an empty request on change (lines 130-132). Both the tabParent value needs to exist and on each container the class remove-rd so that the remove action is intentional, especially given this is undesirable in the case where the tab doesn't need to be refreshed.

The point of that was to solve the issue of binding events to hidden tab content.
updating after non compressed version changes
updated version number as per readme file
updated version number as per readme file
@thecodeassassin
Copy link
Owner

I have a question about your changes, i am not sure what the tab parent is used for. Could you maybe provide a sample page describing the functionality (or some screenshots)?

@StephenNeate
Copy link
Author

Will do, busy day ahead of me, so might need to get to it over the weekend.

@thecodeassassin
Copy link
Owner

Can you update this PR?

@StephenNeate
Copy link
Author

Sorry, dude forgot to come back to this, will work out an example later today

@StephenNeate
Copy link
Author

Ok here is a screen of the implementation in the markup...

Parent Tabs...
image

Containers, showing the data-parent attribute
image

The scenario here is when clicking on #listings all other tabs have had their content removed out of the markup. Reason for this is to allow for common class names on markup (eg. binding a function to .data-table where a post request on show will populate data) so that only the dom of active tab is triggered. It also has the benefit of re-drawing the tab-pane with fresh content instead of showing last view then refreshing with correct view after remote call.

I couldn't get a more elegant scenario to work so did the above. If I do think of a nicer approach I can always re-submit.

As I mentioned, it may be too much of an edge case usage, so leaving it in my fork and cancelling the PR may be a better preference.

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

Successfully merging this pull request may close these issues.

2 participants