FIX_FE_content api
This commit is contained in:
parent
b100c462af
commit
85c4794e84
@ -460,7 +460,7 @@
|
|||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
toastr.error("Something went wrong!", 'Error');
|
toastr.error("Something went wrong!", 'Error');
|
||||||
}
|
}}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -478,8 +478,13 @@
|
|||||||
function appendEditData(data) {
|
function appendEditData(data) {
|
||||||
$('#frontEndContentForm')[0].reset();
|
$('#frontEndContentForm')[0].reset();
|
||||||
$('#fe_id').val(data.id);
|
$('#fe_id').val(data.id);
|
||||||
|
if (/video/i.test(data.content_section)) {
|
||||||
|
$('#content_section').val('Video');
|
||||||
|
$('#type').val(8);
|
||||||
|
} else {
|
||||||
$('#type').val(data.type);
|
$('#type').val(data.type);
|
||||||
$('#content_section').val(data.content_section);
|
$('#content_section').val(data.content_section);
|
||||||
|
}
|
||||||
$('#heading').val(data.heading);
|
$('#heading').val(data.heading);
|
||||||
// $('#content').val(data.content);
|
// $('#content').val(data.content);
|
||||||
// $('#notes').val(data.notes);
|
// $('#notes').val(data.notes);
|
||||||
@ -533,6 +538,34 @@
|
|||||||
|
|
||||||
return text.length === 0;
|
return text.length === 0;
|
||||||
}
|
}
|
||||||
|
// $('#content_section').on('keyup blur change', function () {
|
||||||
|
// let val = $(this).val();
|
||||||
|
// if (/video/i.test(val)) {
|
||||||
|
// $(this).val('Video');
|
||||||
|
// $('#type').val(8);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
$('#content_section').on('input blur', function () {
|
||||||
|
let $this = $(this);
|
||||||
|
let val = $this.val().trim();
|
||||||
|
|
||||||
|
// 1. Handle Empty Input
|
||||||
|
if (val === '') {
|
||||||
|
$('#type').val('');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Check for "video" (case insensitive)
|
||||||
|
if (/video/i.test(val)) {
|
||||||
|
$('#type').val(8);
|
||||||
|
if (val !== 'Video') { $this.val('Video'); }
|
||||||
|
} else {
|
||||||
|
$('#type').val('');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user