mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2024-12-04 22:11:06 +01:00
Exclude related JavaScript function from staff Ticket view when attachments are not enabled
This commit is contained in:
parent
3dcbdad638
commit
78cf89ca9b
@ -266,7 +266,7 @@ $( function() {
|
||||
</script>
|
||||
|
||||
<script type='text/javascript' language='javascript'>
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function() {
|
||||
$("#ShowFurtherEditOptions").click(function() {
|
||||
$("#FurtherEditOptions").toggle();
|
||||
});
|
||||
@ -275,11 +275,6 @@ $(document).ready(function() {
|
||||
$("#checklistEdit").toggle();
|
||||
});
|
||||
|
||||
$("#ShowFileUpload").click(function() {
|
||||
$("#FileUpload").fadeIn();
|
||||
$("#ShowFileUploadPara").hide();
|
||||
});
|
||||
|
||||
$('#id_preset').change(function() {
|
||||
preset = $('#id_preset').val();
|
||||
if (preset != '') {
|
||||
@ -304,6 +299,12 @@ $(document).ready(function() {
|
||||
|
||||
$("[data-toggle=tooltip]").tooltip();
|
||||
|
||||
{% if helpdesk_settings.HELPDESK_ENABLE_ATTACHMENTS %}
|
||||
$("#ShowFileUpload").click(function() {
|
||||
$("#FileUpload").fadeIn();
|
||||
$("#ShowFileUploadPara").hide();
|
||||
});
|
||||
|
||||
// lists for file input change events, then updates the associated text label
|
||||
// with the file name selected
|
||||
$('.add_file_fields_wrap').on('fileselect', ':file', function(event, numFiles, label, browseButtonNum) {
|
||||
@ -319,18 +320,20 @@ $(document).ready(function() {
|
||||
e.preventDefault();
|
||||
$(wrapper).append("<div><label class='btn btn-primary btn-sm btn-file'>Browse... <input type='file' name='attachment' id='file" + x + "' multiple style='display: none;'/></label><span> </span><span id='selectedfilename" + x + "'>{% trans 'No files selected.' %}</span></div>"); //add input box
|
||||
});
|
||||
{% endif %}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// this function listens for changes on any file input, and
|
||||
// emits the appropriate event to update the input's text.
|
||||
// Needed to have properly styled file input buttons! (this really shouldn't be this hard...)
|
||||
$(document).on('change', ':file', function() {
|
||||
{% if helpdesk_settings.HELPDESK_ENABLE_ATTACHMENTS %}
|
||||
// this function listens for changes on any file input, and
|
||||
// emits the appropriate event to update the input's text.
|
||||
// Needed to have properly styled file input buttons! (this really shouldn't be this hard...)
|
||||
$(document).on('change', ':file', function() {
|
||||
var input = $(this),
|
||||
inputWidgetNum = $(this).attr('id').split("file")[1],
|
||||
numFiles = input.get(0).files ? input.get(0).files.length : 1,
|
||||
label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
|
||||
input.trigger('fileselect', [numFiles, label, inputWidgetNum]);
|
||||
});
|
||||
</script>
|
||||
});
|
||||
{% endif %}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user