Skip to content

Commit 1f7f117

Browse files
committed
fix: Restrict files to png & jpg. Reset sliders to zero
1 parent 430a7d7 commit 1f7f117

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/components/CanvasEditor.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
type="file"
2424
class="hidden"
2525
ref="fileSelector"
26+
accept="image/png, image/jpeg"
2627
@change="loadImageFile"
2728
/>
2829
</div>

src/views/Home.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,16 @@ export default {
4545
data() {
4646
return {
4747
disabledControls: true,
48-
settings: { brightness: 0, contrast: 0 }
48+
settings: this.initSettings()
4949
};
5050
},
5151
methods: {
52+
initSettings() {
53+
return { brightness: 0, contrast: 0 };
54+
},
5255
imageLoaded() {
5356
this.disabledControls = false;
57+
this.settings = this.initSettings();
5458
}
5559
}
5660
};

0 commit comments

Comments
 (0)