History button now close history panel when it is open in drive

pull/1/head
ClemDee 6 years ago
parent 0c66c19466
commit a1163798de

@ -791,16 +791,23 @@ define([
button = $('<span>'); button = $('<span>');
break; break;
} }
var active = $(".cp-toolbar-history:visible").length !== 0;
button = $('<button>', { button = $('<button>', {
title: Messages.historyButton, title: active ? Messages.history_closeTitle : Messages.historyButton,
'class': "fa fa-history cp-toolbar-icon-history", 'class': "fa fa-history cp-toolbar-icon-history",
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.historyText)); }).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.historyText));
button.toggleClass("active", active);
if (data.histConfig) { if (data.histConfig) {
button if (active) {
.click(common.prepareFeedback(type)) button.click(function () { $(".cp-toolbar-history-close").trigger("click"); });
.on('click', function () { }
common.getHistory(data.histConfig); else {
}); button
.click(common.prepareFeedback(type))
.on('click', function () {
common.getHistory(data.histConfig);
});
}
} }
break; break;
case 'more': case 'more':

@ -770,6 +770,9 @@
.cp-toolbar-icon-history { .cp-toolbar-icon-history {
float: right; float: right;
&.active {
background-color: rgba(0, 0, 255, 0.2);
}
.cp-toolbar-drawer-element { .cp-toolbar-drawer-element {
display: none; display: none;
} }

Loading…
Cancel
Save