Modify

Opened 17 years ago

Closed 13 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)

Change History (1)

comment:1 Changed 13 years ago by Ryan J Ollos

Resolution: wontfix
Status: newclosed

Plugin is deprecated.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Noah Kantrowitz.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.