| 6 |
function flipLink(element, settings) { |
function flipLink(element, settings) { |
| 7 |
// Get the current status by reading the class names. |
// Get the current status by reading the class names. |
| 8 |
var current_class = $(element).attr('class'); |
var current_class = $(element).attr('class'); |
| 9 |
if (current_class.indexOf('views-bookmark-unmark') == -1) { |
if (current_class.indexOf('views-bookmark-mark ') == -1) { |
|
// Add the unmark link. |
|
|
var new_link = $(settings.unmark); |
|
|
} |
|
|
else { |
|
| 10 |
// Add the mark link. |
// Add the mark link. |
| 11 |
var new_link = $(settings.mark); |
var new_link = $(settings.mark); |
| 12 |
} |
} |
| 13 |
|
else { |
| 14 |
|
// Add the unmark link. |
| 15 |
|
var new_link = $(settings.unmark); |
| 16 |
|
} |
| 17 |
|
|
| 18 |
// Reattach the behavior to the new link. |
// Reattach the behavior to the new link. |
| 19 |
if ($('a', new_link).size() > 0) { |
if ($('a', new_link).size() > 0) { |