Mimic the keymap remove with the option to undo the last one.

This commit is contained in:
Arpad Csanyi
2016-06-16 00:32:44 +02:00
parent ee709258b3
commit 769d4a1c70

12
app.js
View File

@@ -35,6 +35,9 @@ $(function() {
_newView.find('.keymap__remove').show();
}
// Hide (undo) notification if any was shown.
$('.notification').hide();
// Fill pane title based on data attributes.
if (dataName != '') {
_newView.find('.pane-title__name').text(dataName);
@@ -119,6 +122,10 @@ $(function() {
});
$('.keymap__remove').on('click', function(e) {
// Mimic the removal of a keymap with undo option.
$('.sidebar__level-2--item:hidden').remove();
$('.sidebar__level-2--item.active').hide();
// Show the factory keymap after removal of a keymap.
$('.sidebar__level-2--item:first').click();
$('.notification').show();
@@ -126,7 +133,10 @@ $(function() {
$('.notification').on('click', '.notification__dismiss', function(e) {
$('.notification').hide();
});
}).on('click', '.notification__action--undo', function(e) {
$('.notification').hide();
$('.sidebar__level-2--item:hidden').show().click();
});;
// Based on: http://stackoverflow.com/a/24933495
$('img.uhk').each(function(){