cartads: don't display initial file widget for specific pieces (#35337)
This commit is contained in:
parent
826df49d4e
commit
2d0b749e17
|
@ -23,3 +23,19 @@ div.cartads-piece {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
div.pieces-specifiques ~ div.cartads-piece {
|
||||
// for specific pieces don't display initial widget
|
||||
div.title + div.file-upload-widget {
|
||||
display: none;
|
||||
}
|
||||
div.title + div.file-upload-widget.visible {
|
||||
display: block;
|
||||
}
|
||||
div.title + div.file-upload-widget:not(.visible) + div.button-plus {
|
||||
button {
|
||||
margin-top: 0;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,12 @@ $('.file-upload-widget input[type=file]').on('change', $.CartaDs.change);
|
|||
$('.file-upload-widget.has-file input[type=file]').each($.CartaDs.change);
|
||||
|
||||
$('button.plus').on('click', function() {
|
||||
var $file_button = $(this).parent().prev().clone();
|
||||
var $orig_file_button = $(this).parent().prev();
|
||||
if (! $orig_file_button.is(':visible')) {
|
||||
$orig_file_button.addClass('visible');
|
||||
return false;
|
||||
}
|
||||
var $file_button = $orig_file_button.clone();
|
||||
$file_button.find('div.title').remove();
|
||||
$file_button.find('input[type=hidden]').val('');
|
||||
$file_button.find('.fileinfo').hide();
|
||||
|
|
Loading…
Reference in New Issue