Modify

Opened 8 years ago

Closed 3 years ago

#1659 closed defect (wontfix)

prevent duplicate entries in the ctxtnav

Reported by: kckrinke Owned by: coderanger
Priority: normal Component: CtxtnavAddPlugin
Severity: normal Keywords:
Cc: kevin@… 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 3 years ago by rjollos

  • Resolution set to wontfix
  • Status changed from new to closed

Plugin is deprecated.

Add Comment

Modify Ticket

Action
as closed The owner will remain coderanger.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.