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:
4a903d6
)
kivi.detect_duplicate_ids_in_dom: Funktion zum Auffinden doppelter IDs im DOM
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Tue, 10 Jan 2017 14:52:09 +0000
(15:52 +0100)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Tue, 10 Jan 2017 14:59:23 +0000
(15:59 +0100)
js/kivi.js
patch
|
blob
|
history
diff --git
a/js/kivi.js
b/js/kivi.js
index
c456bd7
..
1738422
100644
(file)
--- a/
js/kivi.js
+++ b/
js/kivi.js
@@
-415,6
+415,22
@@
namespace("kivi", function(ns) {
console.error('kivi.run("' + function_name + '"): No function by that name found');
return undefined;
};
+
+ ns.detect_duplicate_ids_in_dom = function() {
+ var ids = {},
+ found = false;
+
+ $('[id]').each(function() {
+ if (this.id && ids[this.id]) {
+ found = true;
+ console.warn('Duplicate ID #' + this.id);
+ }
+ ids[this.id] = 1;
+ });
+
+ if (!found)
+ console.log('No duplicate IDs found :)');
+ };
});
kivi = namespace('kivi');