Fix issues with trim history button

pull/1/head
yflory 5 years ago
parent 6f742fc295
commit 59d23ef5ff

@ -68,6 +68,9 @@
}
}
}
button.cp-button-confirm-placeholder {
margin-bottom: 3px !important;
}
button:not(.pure-button):not(.md-button):not(.mdl-button) {

@ -623,9 +623,9 @@ define([
var to;
var done = function (res) {
cb(res);
if (res) { cb(res); }
clearTimeout(to);
$(content).remove();
$(content).detach();
$(originalBtn).show();
};
@ -646,9 +646,12 @@ define([
$(div).css('width', p+'%');
to = setTimeout(todo, INTERVAL);
};
to = setTimeout(todo, INTERVAL);
$(originalBtn).addClass('cp-button-confirm-placeholder').click(function () {
i = 1;
to = setTimeout(todo, INTERVAL);
$(originalBtn).hide().after(content);
});
};

@ -825,12 +825,9 @@ define([
$d.append(size);
var $button = $(button);
$button.click(function () {
UI.confirmButton(button, {
classes: 'btn-danger'
}, function (yes) {
if (!yes) { return; }
}, function () {
$button.remove();
spinner.spin();
history.execCommand('TRIM_HISTORY', {
@ -850,7 +847,7 @@ define([
h('br'),
h('span.cp-app-prop-content', formatted)
]));
});
$d.append(h('div.alert.alert-success', Messages.trimHistory_success));
});
});

@ -1258,12 +1258,10 @@ define([
return;
}
$(currentSize).html(Messages._getKey('trimHistory_currentSize', [UIElements.prettySize(size)]));
$button.click(function () {
$button.prop('disabled', '');
UI.confirmButton(button, {
classes: 'btn-danger'
}, function (yes) {
if (!yes) { return; }
}, function () {
$button.remove();
spinner.spin();
APP.history.execCommand('TRIM_HISTORY', {
@ -1278,7 +1276,6 @@ define([
redrawTrimHistory(cb, $div);
});
});
}).prop('disabled', '');
});
$div.find('#cp-settings-trim-container').remove();

Loading…
Cancel
Save