Modify ↓
Opened 18 years ago
Closed 14 years ago
#1659 closed defect (wontfix)
prevent duplicate entries in the ctxtnav
| Reported by: | Kevin C. Krinke | Owned by: | Noah Kantrowitz |
|---|---|---|---|
| Priority: | normal | Component: | CtxtnavAddPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Kevin C. Krinke | Trac Release: | 0.10 |
Description
Not really sure if this is a major problem or not but with the ctxtnav plugin I've made for my personal site, I end up with duplicates in the nav menu. The following change prevents any duplicate entries.
Index: 0.10/ctxtnavadd/web_ui.py
===================================================================
--- ctxtnavadd/web_ui.py (revision 21)
+++ ctxtnavadd/web_ui.py (revision 22)
@@ -81,7 +81,10 @@
href, text = add
adds.append(Markup('<a href="%s">%s</a>'%(href,Markup.escape(text,False))))
js = ""
+ added = []
for add in adds:
- js += "add_ctxtnav('%s');\n"%add
+ if add not in added:
+ js += "add_ctxtnav('%s');\n"%add
+ added.append( add )
return """<script type="text/javascript">%s</script>"""%js
Attachments (0)
Note: See
TracTickets for help on using
tickets.



Plugin is deprecated.