-
Notifications
You must be signed in to change notification settings - Fork 556
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
expandable doesn't work within a tabarray #45
Comments
I think the problem is that expandable sections are initialized when the form is created (row 3252 in jsonform.js): // Initialize expandable sections, if any
$('.expandable > div, .expandable > fieldset', formElt).hide();
$('.expandable > legend', formElt).click(function () {
var parent = $(this).parent();
parent.toggleClass('expanded');
$('> div', parent).slideToggle(100);
}); When a new item in an array is added, such as in a tab array, this initialization is not done and hence there is no function attached to the mouse click nor is the section hidden as default. I think the solution is to add something very similar to the above but in this function (row 845 in jsonform.js): $('> a._jsonform-array-addmore', $nodeid).click(function (evt) { I know too little javascript to alter the above code correctly so that it works, but I'll see what I can find out! |
Great - just found a way around it, I think. I'll submit a pull request later during the weekend. |
Haven't looked at the code that well (so ignore at will) but this seems See: http://api.jquery.com/on/ for more info. Generally instead of: you'd write: 2013/4/26 mkirsten notifications@github.com
|
Ah, that sounds like exactly what we need. I couldn't get it work unfortunately and to my great disappointment, I realised that my so called fix introduces some side effects. I'll see if I can fix it and will post back here regardless. |
Fixed in the above mentioned commit of my branch. |
… Fix for jsonform#292: only hide expanded in children;
Setting the expandable property to true for a fieldset works fine for the first item in a tabarray. In item 2 it is no longer possible to collapse (or expand) the fieldset. Example:
The text was updated successfully, but these errors were encountered: