Skip to content

Commit b1e8385

Browse files
committed
Fixed delete buttons for backgrounds
1 parent 4760e63 commit b1e8385

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

static/files/background-setting.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ function deleteButtonEvent(event) {
334334
var backgroundAttribute = divElement.getAttribute("background");
335335
var filteredBackgrounds = backgrounds_array.filter(item => !item.startsWith("//"))
336336
console.log(filteredBackgrounds.length);
337-
if (divElement && (!backgroundAttribute.startsWith("//") && filteredBackgrounds.length !== 1)) {
337+
if ((divElement != null && filteredBackgrounds.length != 1) || backgroundAttribute.startsWith("//")) {
338338
divElement.remove();
339339
backgrounds_array = removeBackgroundFromArray();
340340
}

templates/index.jinja

+2-2
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@
598598
</div>
599599
</div>
600600
{% elif bg.endswith(".mp4") %}
601-
<div class="choose-bg-element choose-bg-element-image {{black_theme}}" background="{{bg.replace('//','')}}">
601+
<div class="choose-bg-element choose-bg-element-image {{black_theme}}" background="{{bg}}">
602602

603603
<div class="video-container choose-bg-pseudo-element">
604604
<video autoplay muted loop class="blurred-video">
@@ -630,7 +630,7 @@
630630
</div>
631631
</div>
632632
{% else %}
633-
<div class="choose-bg-element choose-bg-element-image {{black_theme}}" background="{{bg.replace('//','')}}">
633+
<div class="choose-bg-element choose-bg-element-image {{black_theme}}" background="{{bg}}">
634634
<div class="choose-bg-pseudo-element" style="background-image: url('{{ 'static/files/uploaded/' + bg.replace('//','').replace('**uploaded/', '') }}')"></div>
635635
<img src="{{ 'static/files/uploaded/' + bg.replace('//','').replace('**uploaded/', '') }}">
636636
<div class="choose-bg-buttons">

0 commit comments

Comments
 (0)