You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a new gallery, the default template's associated fields don't show. If you change the template select input to another template, and then change it back, the fields do appear, however they don't when the page first loads. Seems like whatever function is getting triggered by the select change also needs to get triggered when the page loads.
Looks like the issue starts here (line 26 of admin-foogallery.js):
FOOGALLERY.initSettings = function() {
$('#FooGallerySettings_GalleryTemplate').change(function() {
var $this = $(this),
selectedTemplate = $this.val(),
selectedPreviewCss = $this.find(":selected").data('preview-css');
//hide all template fields
$('.foogallery-metabox-settings .gallery_template_field').not('.gallery_template_field_selector').hide();
//show all fields for the selected template only
$('.foogallery-metabox-settings .gallery_template_field-' + selectedTemplate).show();
//include a preview CSS if possible
FOOGALLERY.includePreviewCss();
//trigger a change so custom template js can do something
FOOGALLERY.triggerTemplateChangedEvent();
});
//include our selected preview CSS
FOOGALLERY.includePreviewCss();
//trigger this onload too!
FOOGALLERY.triggerTemplateChangedEvent();
};
The hiding/showing is only triggered on $('#FooGallerySettings_GalleryTemplate').change(), but it needs to be triggered on load as well.
When creating a new gallery, the default template's associated fields don't show. If you change the template select input to another template, and then change it back, the fields do appear, however they don't when the page first loads. Seems like whatever function is getting triggered by the select change also needs to get triggered when the page loads.
Here's a .gif to illustrate: http://recordit.co/zDFasgpjZs
The text was updated successfully, but these errors were encountered: