X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=js%2Fkivi.ActionBar.js;h=597b48528e96c4b9ee62b546eaeba0fcc6c99d39;hb=667da13fe922194e3dbbaa30662754b30e4ca826;hp=17fd7f7bbcdf597f81bd379e04f3263b08d88d07;hpb=72d64df189526f6b4c9bd24b0adc5c00b450ffe7;p=kivitendo-erp.git diff --git a/js/kivi.ActionBar.js b/js/kivi.ActionBar.js index 17fd7f7bb..597b48528 100644 --- a/js/kivi.ActionBar.js +++ b/js/kivi.ActionBar.js @@ -40,9 +40,27 @@ namespace('kivi', function(k){ if (target === undefined) { target = 'document'; } + + var normalized = $.map(String.prototype.split.call(keystring, '+'), function(val, i) { + console.log(keystring) + switch (val) { + case 'ctrl': + case 'alt': return val; + case 'enter': return 13; + default: + if (val.length == 1) { + return val.charChodeAt(0) + } else if (val % 1 === 0) { + return val; + } else { + console.log('can not normalize access key token: ' + val); + } + } + }).join('+'); + if (!(target in this.actions)) this.actions[target] = {}; - this.actions[target][keystring] = action; + this.actions[target][normalized] = action; }, bind_targets: function(){ @@ -96,6 +114,10 @@ namespace('kivi', function(k){ } } + if (data.tooltip) { + $(e).tooltipster({ content: data.tooltip, theme: 'tooltipster-light' }); + } + if (data.call || data.submit) { $(e).click(function(event) { var $hidden, key, func, check;