[-] BO : FixBug #PSCSX-37 - Double upload in carrier wizard
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
<input type="hidden" id="logo" name="logo" value="" />
|
||||
<div class="dummyfile input-group">
|
||||
<span class="input-group-addon"><i class="icon-file"></i></span>
|
||||
<input id="attachement_filename" type="text" class="disabled" name="filename" readonly="">
|
||||
<input id="attachement_filename" type="text" name="filename" readonly="">
|
||||
<span class="input-group-btn">
|
||||
<button id="attachement_fileselectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
|
||||
<i class="icon-folder-open"></i> Choose a file
|
||||
@@ -58,19 +58,6 @@
|
||||
{l s='Current size:'} <span id="carrier_logo_size">{l s='undefined'}</span>.
|
||||
</p>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#attachement_fileselectbutton').click(function(e){
|
||||
$('#carrier_logo_input').trigger('click');
|
||||
return false;
|
||||
});
|
||||
$('#carrier_logo_input').change(function(e){
|
||||
var val = $(this).val();
|
||||
var file = val.split(/[\\/]/);
|
||||
$('#attachement_filename').val(file[file.length-1]);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
{$smarty.block.parent}
|
||||
{/block}
|
||||
|
||||
@@ -31,6 +31,33 @@ $(document).ready(function() {
|
||||
if (parseInt($('input[name="is_free"]:checked').val()))
|
||||
is_freeClick($('input[name="is_free"]:checked'));
|
||||
displayRangeType();
|
||||
|
||||
$('#attachement_fileselectbutton').click(function(e) {
|
||||
$('#carrier_logo_input').trigger('click');
|
||||
});
|
||||
|
||||
$('#attachement_filename').click(function(e) {
|
||||
$('#carrier_logo_input').trigger('click');
|
||||
});
|
||||
|
||||
$('#carrier_logo_input').change(function(e) {
|
||||
if ($(this)[0].files !== undefined)
|
||||
{
|
||||
var files = $(this)[0].files;
|
||||
var name = '';
|
||||
|
||||
$.each(files, function(index, value) {
|
||||
name += value.name+', ';
|
||||
});
|
||||
|
||||
$('#attachement_filename').val(name.slice(0, -2));
|
||||
}
|
||||
else // Internet Explorer 9 Compatibility
|
||||
{
|
||||
var name = $(this).val().split(/[\\/]/);
|
||||
$('#attachement_filename').val(name[name.length-1]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function initCarrierWizard()
|
||||
|
||||
Reference in New Issue
Block a user