Skip to content

Commit 2b76305

Browse files
committed
Add: Confirmation Dialog before Deletion
1 parent 8459a63 commit 2b76305

File tree

6 files changed

+3897
-7
lines changed

6 files changed

+3897
-7
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# See https://help.github.com/ignore-files/ for more about ignoring files.
22

3-
#WebStorm local user files
3+
# WebStorm local user files
44
/.idea/
55

66
# compiled output

app/pods/questions/index/template.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
{{question.description}}
1616
</p>
1717
<div class="button-solid">
18+
{{#confirm-dialog
19+
dialogClass="custom-confirm-dialog"
20+
title="Delete Question"
21+
text="Are you sure you want to delete this question?"}}
1822
<button {{action "deleteQuestion" question}}>Delete</button>
23+
{{/confirm-dialog}}
1924
</div>
2025
<div class="button-solid">
2126
{{#link-to 'questions.id' question.id class="white"}}

app/styles/app.scss

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
@import "ember-searchable-select/style";
2+
@import "ember-modal-dialog/ember-modal-structure";
3+
@import "ember-modal-dialog/ember-modal-appearance";
24

35
.card {
46
height: auto;
@@ -25,5 +27,22 @@
2527
}
2628

2729
.correct {
28-
background-color: rgba(0, 255, 0, 0.1);
29-
}
30+
background-color: rgba(0, 255, 0, 0.1);
31+
}
32+
.custom-confirm-dialog {
33+
34+
.dialog-title{
35+
background-color: #bbc7bc;
36+
font-weight: bold;
37+
padding: 10px;
38+
}
39+
40+
.dialog-text{
41+
margin: 0px;
42+
}
43+
44+
.dialog-footer{
45+
background-color: #fcffb0;
46+
padding: 5px;
47+
}
48+
}

0 commit comments

Comments
 (0)