Opened 11 years ago

Closed 6 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


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/
--- ctxtnavadd/        (revision 21)
+++ ctxtnavadd/        (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)

Change History (1)

comment:1 Changed 6 years ago by Ryan J Ollos

Resolution: wontfix
Status: newclosed

Plugin is deprecated.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Noah Kantrowitz.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.