projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f1c3810
)
js/common.js: hash focus funktionalität wiederhergestellt
author
Sven Schöling
<s.schoeling@linet-services.de>
Tue, 6 Dec 2016 09:56:36 +0000
(10:56 +0100)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Fri, 6 Jan 2017 10:22:37 +0000
(11:22 +0100)
js/common.js
patch
|
blob
|
history
diff --git
a/js/common.js
b/js/common.js
index
5f13ee0
..
e19f7f2
100644
(file)
--- a/
js/common.js
+++ b/
js/common.js
@@
-221,6
+221,20
@@
$(function () {
}
}
}
}
+ // all of this screws with the native location.hash focus, so reimplement this as well
+ if (location.hash) {
+ var hash_name = location.hash.substr(1);
+ var $hash_by_id = $(location.hash + ':visible');
+ if ($hash_by_id.length > 0) {
+ $hash_by_id.get(0).focus();
+ } else {
+ var $by_name = $('[name=' + hash_name + ']:visible');
+ if ($by_name.length > 0) {
+ $by_name.get(0).focus();
+ }
+ }
+ }
+
// legacy. sone forms install these
if (typeof fokus == 'function') { fokus(); return; }
if (focus_by_name('cursor_fokus')) return;
// legacy. sone forms install these
if (typeof fokus == 'function') { fokus(); return; }
if (focus_by_name('cursor_fokus')) return;