Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit c6f0645

Browse files
committed
Add confirm to grid delete button
1 parent 9b6ce26 commit c6f0645

File tree

3 files changed

+102
-47
lines changed

3 files changed

+102
-47
lines changed

css/obBase.css

Lines changed: 65 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -747,11 +747,45 @@ h6, .h6 {
747747
.gridItemControls .btn-gridItemControl {
748748
text-align: center;
749749
padding: 0;
750-
opacity: .75;
751750
font-weight: 400;
752751
font-size: 12px;
753752
}
754753

754+
.gridItemControls .btn-gridItemControl .gridItemOverlay {
755+
position: absolute;
756+
bottom: 100%;
757+
min-width: 190px;
758+
padding: 10px;
759+
right: 0;
760+
font-size: 16px;
761+
font-weight: 700;
762+
border-width: 1px;
763+
border-style: solid;
764+
border-right-width: 0;
765+
border-top-left-radius: 2px;
766+
}
767+
768+
.gridItemControls .btn-gridItemControl .gridItemOverlay .btn {
769+
font-size: 15px;
770+
font-weight: 400;
771+
}
772+
773+
.gridItemControls .btn-gridItemControl .gridItemOverlay:before {
774+
content: "";
775+
position: absolute;
776+
right: 40px;
777+
top: 100%;
778+
width: 12px;
779+
height: 12px;
780+
transform: rotate(45deg);
781+
-webkit-clip-path: polygon(100% 0, 0% 100%, 100% 100%);
782+
border-width: 1px;
783+
border-style: solid;
784+
border-color: inherit;
785+
background: inherit;
786+
margin-top: -7px;
787+
}
788+
755789
.gridItemControls .btn-gridItemControl:hover {
756790
opacity: 1;
757791
}
@@ -4729,6 +4763,31 @@ input[type="checkbox"].fieldItem:checked + label .togLabelOff {
47294763
display: none;
47304764
}
47314765

4766+
.buyWizardMap .mapWrap {
4767+
background-color: #eeeae1;
4768+
height: 100%;
4769+
}
4770+
4771+
.backToTop {
4772+
position: fixed;
4773+
bottom: 15px;
4774+
right: 73px;
4775+
padding: 10px;
4776+
background-color: #252525;
4777+
transform: translateY(100%);
4778+
opacity: 0;
4779+
transition: transform 300ms ease, right 0.5s ease;
4780+
}
4781+
4782+
.backToTop.slideUp {
4783+
opacity: 1;
4784+
transform: translateY(0);
4785+
}
4786+
4787+
#ov1.chatOpen .backToTop {
4788+
right: 303px;
4789+
}
4790+
47324791
/*========== utility classes ==========*/
47334792

47344793
/* the #ov1 id is on the HTML tag. It is used to force specificity
@@ -5947,6 +6006,7 @@ input[type="checkbox"].fieldItem:checked + label .togLabelOff {
59476006
}
59486007

59496008
#ov1 .fadeIn {
6009+
/* use fadeOut on items that should have fadeIn added to them */
59506010
opacity: 1;
59516011
pointer-events: auto;
59526012
transition: opacity .3s cubic-bezier(0, 0, 0.2, 1);
@@ -6176,6 +6236,10 @@ input[type="checkbox"].fieldItem:checked + label .togLabelOff {
61766236
background: #262626 !important;
61776237
}
61786238

6239+
#ov1.notFancy .addressFormOpened .buyWizardMap .blurMore {
6240+
display: none;
6241+
}
6242+
61796243
#ov1.notFancy .disabled,
61806244
#ov1.notFancy #userPage .disabled,
61816245
#ov1.notFancy #obContainer .disabled,
@@ -6236,32 +6300,3 @@ input[type="checkbox"].fieldItem:checked + label .togLabelOff {
62366300
#ov1 .TODO.TODO.TODO.TODO.TODO {
62376301
display: none; /* hide in production */
62386302
}
6239-
6240-
#ov1.notFancy .addressFormOpened .buyWizardMap .blurMore {
6241-
display: none;
6242-
}
6243-
6244-
.buyWizardMap .mapWrap {
6245-
background-color: #eeeae1;
6246-
height: 100%;
6247-
}
6248-
6249-
.backToTop {
6250-
position: fixed;
6251-
bottom: 15px;
6252-
right: 73px;
6253-
padding: 10px;
6254-
background-color: #252525;
6255-
transform: translateY(100%);
6256-
opacity: 0;
6257-
transition: transform 300ms ease, right 0.5s ease;
6258-
}
6259-
6260-
.backToTop.slideUp {
6261-
opacity: 1;
6262-
transform: translateY(0);
6263-
}
6264-
6265-
#ov1.chatOpen .backToTop {
6266-
right: 303px;
6267-
}

js/templates/itemShort.html

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,46 +36,53 @@
3636
<div>
3737
<% if(ob.discover) { %>
3838
<div class="btn-gridItemControl borderRight custCol-border js-about">
39-
<span class="ion-ios-book fontSize11 marginRight2 textOpacity1"></span>
40-
<%= polyglot.t('About') %>
39+
<span class="ion-ios-book fontSize11 marginRight2 txt-fade"></span>
40+
<span class="txt-fade"><%= polyglot.t('About') %></span>
4141
</div>
4242

4343
<% if(!ob.micro && !ob.hideFollow){ %>
4444
<div class="btn-gridItemControl borderRight custCol-border js-userShortUnfollow <% if(!ob.ownFollowing){ %> hide <% } %>">
45-
<span class="ion-eye-disabled fontSize11 marginRight2 textOpacity1"></span>
45+
<span class="ion-eye-disabled fontSize11 marginRight2 txt-fade"></span>
4646
<%= polyglot.t('Unfollow') %>
4747
</div>
4848
<div class="btn-gridItemControl borderRight custCol-border js-userShortFollow <% if(ob.ownFollowing){ %> hide <% } %>">
49-
<span class="ion-person-add fontSize11 marginRight2 textOpacity1"></span>
50-
<%= polyglot.t('Follow') %>
49+
<span class="ion-person-add fontSize11 marginRight2 txt-fade"></span>
50+
<span class="txt-fade"><%= polyglot.t('Follow') %></span>
5151
</div>
5252
<% } %>
5353

5454
<div class="btn-gridItemControl custCol-border <%= !ob.isBlocked ? 'js-blockUser' : 'js-unblockUser' %>">
55-
<span class="<%= !ob.isBlocked ? 'ion-sad' : 'ion-happy' %> fontSize11 marginRight2 textOpacity1"></span>
56-
<%= !ob.isBlocked ? polyglot.t('Block') : polyglot.t('Unblock') %>
55+
<span class="<%= !ob.isBlocked ? 'ion-sad' : 'ion-happy' %> fontSize11 marginRight2 txt-fade"></span>
56+
<span class="txt-fade"><%= !ob.isBlocked ? polyglot.t('Block') : polyglot.t('Unblock') %></span>
5757
</div>
5858
<% } %>
5959

6060
<% if(ob.ownPage){ %>
6161
<div class="btn-gridItemControl borderRight custCol-border js-itemShortEdit">
62-
<span class="ion-compose fontSize11 marginRight2 textOpacity1"></span>
63-
<%= polyglot.t('Edit') %>
62+
<span class="ion-compose fontSize11 marginRight2 txt-fade"></span>
63+
<span class="txt-fade"><%= polyglot.t('Edit') %></span>
6464
</div>
6565
<div class="btn-gridItemControl borderRight custCol-border js-itemShortClone">
66-
<span class="ion-ios-copy fontSize11 marginRight2 textOpacity1"></span>
67-
<%= polyglot.t('Clone') %>
66+
<span class="ion-ios-copy fontSize11 marginRight2 txt-fade"></span>
67+
<span class="txt-fade"><%= polyglot.t('Clone') %></span>
6868
</div>
69-
<div class="btn-gridItemControl borderRight custCol-border js-itemShortDelete">
70-
<span class="ion-trash-b fontSize11 marginRight2 textOpacity1"></span>
71-
<%= polyglot.t('Delete') %>
69+
<div class="btn-gridItemControl custCol-border js-itemShortDelete">
70+
<span class="ion-trash-b fontSize11 marginRight2 txt-fade"></span>
71+
<span class="txt-fade"><%= polyglot.t('Delete') %></span>
72+
<div class="gridItemOverlay custCol-primary custCol-border fadeOut js-deleteOverlay">
73+
<span>Are you sure?</span>
74+
<div>
75+
<a class="btn btn-txt custCol-secondary js-itemShortDeleteCancel">Cancel</a>
76+
<a class="btn btn-txt custCol-secondary js-itemShortDeleteConfirm">Yes</a>
77+
</div>
78+
</div>
7279
</div>
7380
<% } %>
7481

7582
<% if(!ob.ownPage && ob.discover === undefined){ %>
7683
<div class="btn-gridItemControl borderRight custCol-border js-item" data-id="<%= ob.contract_hash %>">
77-
<span class="ion-ios-pricetag fontSize10 marginRight2 textOpacity1"></span>
78-
<%= polyglot.t('ViewListing') %>
84+
<span class="ion-ios-pricetag fontSize10 marginRight2 txt-fade"></span>
85+
<span class="txt-fade"><%= polyglot.t('ViewListing') %></span>
7986
</div>
8087
<% } %>
8188
</div>

js/views/itemShortVw.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ module.exports = baseVw.extend({
1515
'click .js-about': 'aboutClick',
1616
'click .js-itemShortEdit': 'editItemClick',
1717
'click .js-itemShortDelete': 'deleteItemClick',
18+
'click .js-itemShortDeleteConfirm': 'deleteItem',
19+
'click .js-itemShortDeleteCancel': 'cancelConfirmDelete',
1820
'click .js-itemShortClone': 'cloneItemClick',
1921
'click .js-userShortFollow': 'followUser',
2022
'click .js-userShortUnfollow': 'unfollowUser',
@@ -92,7 +94,18 @@ module.exports = baseVw.extend({
9294
window.obEventBus.trigger('itemShortEdit', {'contract_hash': this.model.get('contract_hash')});
9395
},
9496

95-
deleteItemClick: function(){
97+
deleteItemClick: function(e){
98+
console.log("1")
99+
this.$(e.target).closest('.gridItemControls').find(".js-deleteOverlay").addClass("fadeIn");
100+
},
101+
102+
cancelConfirmDelete: function(e){
103+
console.log("2")
104+
e.stopPropagation();
105+
this.$(e.target).closest('.gridItemControls').find(".js-deleteOverlay").removeClass("fadeIn");
106+
},
107+
108+
deleteItem: function(){
96109
window.obEventBus.trigger('itemShortDelete', {'contract_hash': this.model.get('contract_hash')});
97110
},
98111

0 commit comments

Comments
 (0)