Files
pathfinder/js/app/ui/dialog/shortcuts.js
Mark Friedrich ec05738cce - code formatting
2018-09-16 23:31:03 +02:00

50 lines
1.2 KiB
JavaScript

/**
* shortcuts dialog
*/
define([
'jquery',
'app/init',
'app/util',
'app/render',
'bootbox',
'app/key',
], function($, Init, Util, Render, bootbox, Key){
'use strict';
let config = {
// map dialog
shortcutsDialogId: 'pf-shortcuts-dialog', // id for shortcuts dialog
};
/**
* shows the map manual modal dialog
*/
$.fn.showShortcutsDialog = function(){
requirejs(['text!templates/dialog/shortcuts.html', 'mustache'], function(template, Mustache){
let data = {
id: config.shortcutsDialogId,
shortcuts: Key.getGroupedShortcuts()
};
let content = Mustache.render(template, data);
// show dialog
let shortcutsDialog = bootbox.dialog({
title: 'Keyboard Shortcuts',
message: content,
size: 'large',
buttons: {
success: {
label: 'close',
className: 'btn-default'
}
},
show: true
});
});
};
});