Skip to content
Snippets Groups Projects
Commit f20d785b authored by Travis Carden's avatar Travis Carden
Browse files

By TravisCarden: Improved readability of compact mode link JavaScript.

parent 9c889036
Branches
Tags
No related merge requests found
......@@ -17,12 +17,12 @@
// Compact mode link.
$('#checklistapi-checklist-form .compact-link a', context).click(function () {
$(this).closest('#checklistapi-checklist-form').toggleClass('compact-mode');
var is_compact_mode = $(this).closest('#checklistapi-checklist-form').hasClass('compact-mode');
$(this)
.text((is_compact_mode) ? Drupal.t('Hide descriptions') : Drupal.t('Show descriptions'))
.attr('title', (is_compact_mode) ? Drupal.t('Compress layout by hiding descriptions.') : Drupal.t('Expand layout to include descriptions.'))
.closest('#checklistapi-checklist-form').toggleClass('compact-mode');
document.cookie = 'Drupal.visitor.checklistapi_compact_mode=' + ((is_compact_mode) ? 0 : 1);
.text((is_compact_mode) ? Drupal.t('Show descriptions') : Drupal.t('Hide descriptions'))
.attr('title', (is_compact_mode) ? Drupal.t('Expand layout to include descriptions.') : Drupal.t('Compress layout by hiding descriptions.'))
document.cookie = 'Drupal.visitor.checklistapi_compact_mode=' + ((is_compact_mode) ? 1 : 0);
return false;
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment