Jump to:
| Project: | Flag |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | mooffie |
| Status: | closed (fixed) |
Issue Summary
When the link says "bookmark this" after page refresh (not after any ajax), if you click on the link, the ajax properly updates the database, but the jquery doesn't properly update the text such that the link still says "bookmark this". If you refresh the page at this point, everything is OK. But if you don't refresh the page, this link says the wrong thing.
This happens because you are searching for a views-bookmark-mark with a space on the end of it, however Firebug shows that the class is there without the space. I think the reason you searched for the class with the space is because it conflicts with the views-bookmark-marked class. So the simplest change is to search for views-bookmark-mark without the space, and to change the views-bookmark-marked to another class name.
| Attachment | Size |
|---|---|
| ajax.patch | 1.63 KB |
Comments
#1
(I won't be able to verify this bug report in the near future, because I can't run Drupal right now.)
1. A quick fix is to change:
var current_class = $(element).attr('class');if (current_class.indexOf('views-bookmark-mark ') == -1) {
to:
if ($(element).is('.views-bookmark-mark')) {2. How is it that we didn't notice this bug before? I'm a bit skeptic ;-)
#2
OK, I commited this.
#3
Now I need to port this.
But first I need to eat ;-)
#4
Commited.
#5
Automatically closed -- issue fixed for two weeks with no activity.