| 1 |
// $Id: views_bookmark.js,v 1.1.2.13 2008/01/07 08:38:56 quicksketch Exp $ |
// $Id: views_bookmark.js,v 1.1.2.14 2008/01/23 21:14:16 quicksketch Exp $ |
| 2 |
if (Drupal.jsEnabled) { |
if (Drupal.jsEnabled) { |
| 3 |
$(document).ready(function () { |
$(document).ready(function () { |
| 4 |
|
|
| 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-mark ') == -1) { |
if (current_class.indexOf('views-bookmark-unmark') == -1) { |
|
// Add the mark link. |
|
|
var new_link = $(settings.mark); |
|
|
} |
|
|
else { |
|
| 10 |
// Add the unmark link. |
// Add the unmark link. |
| 11 |
var new_link = $(settings.unmark); |
var new_link = $(settings.unmark); |
| 12 |
} |
} |
| 13 |
|
else { |
| 14 |
|
// Add the mark link. |
| 15 |
|
var new_link = $(settings.mark); |
| 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) { |