mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
1319db7119
commit
d524366e3e
@ -2175,6 +2175,7 @@ var BrowserPrototype = {
|
|||||||
item_shortcut_marker = item_shortcut_marker ?
|
item_shortcut_marker = item_shortcut_marker ?
|
||||||
RegExp(item_shortcut_marker, 'g')
|
RegExp(item_shortcut_marker, 'g')
|
||||||
: null
|
: null
|
||||||
|
var registered_shortcuts = []
|
||||||
|
|
||||||
//--------------------------------------------- define make ---
|
//--------------------------------------------- define make ---
|
||||||
// XXX revise signature...
|
// XXX revise signature...
|
||||||
@ -2281,7 +2282,7 @@ var BrowserPrototype = {
|
|||||||
var _replace = function(){
|
var _replace = function(){
|
||||||
// get the last group...
|
// get the last group...
|
||||||
var key = [].slice.call(arguments).slice(-3)[0]
|
var key = [].slice.call(arguments).slice(-3)[0]
|
||||||
!item_shortcuts[key]
|
!item_shortcuts[keyboard.normalizeKey(key)]
|
||||||
// NOTE: this is a side-effect...
|
// NOTE: this is a side-effect...
|
||||||
&& that.keyboard.handler(
|
&& that.keyboard.handler(
|
||||||
'ItemShortcuts',
|
'ItemShortcuts',
|
||||||
@ -2291,17 +2292,18 @@ var BrowserPrototype = {
|
|||||||
return key
|
return key
|
||||||
}
|
}
|
||||||
|
|
||||||
txt = txt.replace(item_shortcut_marker, _replace)
|
// clean out markers from text...
|
||||||
|
txt = txt.replace(item_shortcut_marker, '$1')
|
||||||
|
|
||||||
var registered = []
|
|
||||||
p.filter('.text')
|
p.filter('.text')
|
||||||
.each(function(_, e){
|
.each(function(_, e){
|
||||||
e = $(e)
|
e = $(e)
|
||||||
e.html(e.html().replace(item_shortcut_marker,
|
e.html(e.html().replace(item_shortcut_marker,
|
||||||
function(){
|
function(){
|
||||||
var k = _replace.apply(this, arguments)
|
var k = _replace.apply(this, arguments)
|
||||||
var mark = !!(registered.indexOf(k) < 0
|
// only mark the first occurrence...
|
||||||
&& registered.push(k))
|
var mark = !!(registered_shortcuts.indexOf(k) < 0
|
||||||
|
&& registered_shortcuts.push(k))
|
||||||
return mark ?
|
return mark ?
|
||||||
`<span class="keyboard-shortcut">${k}</span>`
|
`<span class="keyboard-shortcut">${k}</span>`
|
||||||
: k
|
: k
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user