mirror of
https://github.com/discourse/discourse.git
synced 2025-05-11 18:03:06 +08:00
Merge pull request #4747 from gsambrotta/show-disable-delete-btn-cat
Show disable delete btn cat
This commit is contained in:
commit
61a7162c01
@ -8,6 +8,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||||||
saving: false,
|
saving: false,
|
||||||
deleting: false,
|
deleting: false,
|
||||||
panels: null,
|
panels: null,
|
||||||
|
hiddenTooltip: true,
|
||||||
|
|
||||||
_initPanels: function() {
|
_initPanels: function() {
|
||||||
this.set('panels', []);
|
this.set('panels', []);
|
||||||
@ -16,6 +17,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||||||
onShow() {
|
onShow() {
|
||||||
this.changeSize();
|
this.changeSize();
|
||||||
this.titleChanged();
|
this.titleChanged();
|
||||||
|
this.set('hiddenTooltip', true);
|
||||||
},
|
},
|
||||||
|
|
||||||
changeSize: function() {
|
changeSize: function() {
|
||||||
@ -101,6 +103,13 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||||||
self.set('deleting', false);
|
self.set('deleting', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
toggleDeleteTooltip() {
|
||||||
|
// check if is touch device
|
||||||
|
if ( $('html').hasClass('discourse-touch') ) {
|
||||||
|
this.toggleProperty('hiddenTooltip');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,8 +28,16 @@
|
|||||||
icon="trash-o"
|
icon="trash-o"
|
||||||
label="category.delete"}}
|
label="category.delete"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="cannot_delete_reason">
|
<div class="disable_info_wrap">
|
||||||
{{{model.cannot_delete_reason}}}
|
{{d-button disabled=deleteDisabled
|
||||||
|
class="disable-no-hover"
|
||||||
|
action="toggleDeleteTooltip"
|
||||||
|
icon="question-circle"
|
||||||
|
label="category.delete"}}
|
||||||
|
|
||||||
|
<div class="cannot_delete_reason {{if hiddenTooltip "hidden" ""}}">
|
||||||
|
{{{model.cannot_delete_reason}}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -332,8 +332,34 @@
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.disable_info_wrap {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
float: right;
|
||||||
|
|
||||||
|
.cannot_delete_reason {
|
||||||
|
position: absolute;
|
||||||
|
background: dark-light-choose(scale-color($primary, $lightness: 10%), scale-color($secondary, $lightness: 10%));
|
||||||
|
color: dark-light-choose(scale-color($primary, $lightness: 100%), scale-color($secondary, $lightness: 0%));
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 2px;
|
||||||
|
padding: 12px 8px;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
top: 100%;
|
||||||
|
left: 57%;
|
||||||
|
border: solid transparent;
|
||||||
|
content: " ";
|
||||||
|
position: absolute;
|
||||||
|
border-top-color: dark-light-choose(scale-color($primary, $lightness: 10%), scale-color($secondary, $lightness: 10%));
|
||||||
|
border-width: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.incoming-email-modal {
|
.incoming-email-modal {
|
||||||
.btn {
|
.btn {
|
||||||
transition: none;
|
transition: none;
|
||||||
|
@ -76,3 +76,11 @@
|
|||||||
.clickable {
|
.clickable {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Buttons
|
||||||
|
// ---------------------------------------------------
|
||||||
|
.disable-no-hover:hover {
|
||||||
|
background: dark-light-choose(scale-color($primary, $lightness: 90%), scale-color($secondary, $lightness: 60%));;
|
||||||
|
color: $primary;
|
||||||
|
}
|
||||||
|
@ -117,11 +117,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cannot_delete_reason {
|
.disable_info_wrap {
|
||||||
float: right;
|
margin-top: -70px;
|
||||||
text-align: right;
|
padding-top: 70px;
|
||||||
max-width: 380px;
|
@media all and (min-width: 550px) {
|
||||||
color: dark-light-choose(scale-color($primary, $lightness: 60%), scale-color($secondary, $lightness: 40%));
|
padding-left: 170px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cannot_delete_reason {
|
||||||
|
top: 4px;
|
||||||
|
right: 4px;
|
||||||
|
max-width: 380px;
|
||||||
|
min-width: 300px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@include hover {
|
||||||
|
.cannot_delete_reason {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,6 +133,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.disable_info_wrap .cannot_delete_reason {
|
||||||
|
top: -114px;
|
||||||
|
right: 8px;
|
||||||
|
min-width: 200px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabbed-modal {
|
.tabbed-modal {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user