summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-09-13 17:04:22 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-09-13 17:04:22 +0200
commit2092ace498c9986bb57ce8c838ae773eac22f3ab (patch)
treeec5d854f7546b9a7bf6b32eed3348cc4f1d64c29
parent4175a006c3a6242e272e8e001a6b6b74449b1666 (diff)
downloadIshtar-2092ace498c9986bb57ce8c838ae773eac22f3ab.tar.bz2
Ishtar-2092ace498c9986bb57ce8c838ae773eac22f3ab.zip
🐛 fix photo selector on mobile device
-rw-r--r--changelog/en/changelog_2022-06-15.md6
-rw-r--r--changelog/fr/changelog_2023-01-25.md7
-rw-r--r--ishtar_common/static/js/ishtar.js2
-rw-r--r--ishtar_common/templates/widgets/image_input.html5
4 files changed, 16 insertions, 4 deletions
diff --git a/changelog/en/changelog_2022-06-15.md b/changelog/en/changelog_2022-06-15.md
index 8261add45..757a23dd6 100644
--- a/changelog/en/changelog_2022-06-15.md
+++ b/changelog/en/changelog_2022-06-15.md
@@ -1,3 +1,9 @@
+v4.0.57 - 2023-09-13
+--------------------
+
+### Bug fixes ###
+- fix photo selector on mobile device
+
v4.0.56 - 2023-09-06
--------------------
diff --git a/changelog/fr/changelog_2023-01-25.md b/changelog/fr/changelog_2023-01-25.md
index 00b99cfbc..ca7049209 100644
--- a/changelog/fr/changelog_2023-01-25.md
+++ b/changelog/fr/changelog_2023-01-25.md
@@ -1,3 +1,10 @@
+v4.0.57 - 2023-09-13
+--------------------
+
+### Corrections de dysfonctionnements ###
+- correction du sélecteur photo sur appareil mobile
+
+
v4.0.56 - 2023-09-06
--------------------
diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js
index 8da971dbd..206a839fd 100644
--- a/ishtar_common/static/js/ishtar.js
+++ b/ishtar_common/static/js/ishtar.js
@@ -2075,8 +2075,10 @@ var register_preview_input_image = function(input_id){
$('#mobile-'+ input_id).change(function (){
if($(this).is(":checked")) {
$("#input-" + input_id).attr("capture", "camera");
+ $("#input-" + input_id).attr("accept", "image/*");
} else {
$("#input-" + input_id).removeAttr("capture");
+ $("#input-" + input_id).removeAttr("accept");
}
});
};
diff --git a/ishtar_common/templates/widgets/image_input.html b/ishtar_common/templates/widgets/image_input.html
index cc2e9811a..50adc2223 100644
--- a/ishtar_common/templates/widgets/image_input.html
+++ b/ishtar_common/templates/widgets/image_input.html
@@ -24,13 +24,12 @@
{% endif %}
<span class="col-8">
<input type="{{ widget.type }}"
- accept="image/*" capture="camera"
onchange="preview_input_image(this, '{{ widget.name }}');"
id="input-{{widget.name}}"
name="{{ widget.name }}"{% include 'django/forms/widgets/attrs.html' %} />
<br class="mobile-capture" style="display:none">
<input type="checkbox" name="mobile-capture" class="mobile-capture" style="display:none"
- id="mobile-{{ widget.name }}" checked>
+ id="mobile-{{ widget.name }}">
<label for="mobile-{{ widget.name }}" class="mobile-capture" style="display:none">{% trans "enable camera" %}</label>
{% if widget.value and widget.value.url %}{% if not widget.required %}
@@ -45,7 +44,6 @@
value="{% if hidden_name_value %}{{hidden_name_value}}{% endif %}"/>
</span>
</div>
-{% if is_initial or widget.value.url %}
<script type="text/javascript">{% localize off %}
$(document).ready(function(){
if (mobile_check()){
@@ -57,4 +55,3 @@ $(document).ready(function(){
register_preview_input_image("{{ widget.name }}");
});
{% endlocalize %}</script>
-{% endif %}