| 4 |
|
|
| 5 |
// Helper function for flipping the bookmark link contents. |
// Helper function for flipping the bookmark link contents. |
| 6 |
function flipLink(element, settings) { |
function flipLink(element, settings) { |
| 7 |
// Get the current status by reading the class names. |
// If this is a 'mark this' link... |
| 8 |
var current_class = $(element).attr('class'); |
if ($(element).is('.views-bookmark-mark')) { |
| 9 |
if (current_class.indexOf('views-bookmark-mark ') == -1) { |
// ...then turn it into an 'unmark this' link; |
| 10 |
// Add the mark link. |
var new_link = $(settings.unmark); |
|
var new_link = $(settings.mark); |
|
| 11 |
} |
} |
| 12 |
else { |
else { |
| 13 |
// Add the unmark link. |
// else, turn it into a 'mark this' link. |
| 14 |
var new_link = $(settings.unmark); |
var new_link = $(settings.mark); |
| 15 |
} |
} |
| 16 |
|
|
| 17 |
// Reattach the behavior to the new link. |
// Reattach the behavior to the new link. |