| 1 |
if (typeof(Drupal) == "undefined" || !Drupal.spaces_dashboard) {
|
| 2 |
Drupal.spaces_dashboard = {};
|
| 3 |
}
|
| 4 |
|
| 5 |
Drupal.spaces_dashboard.setstate = function() {
|
| 6 |
if ($('form#spaces-dashboard-users input[@checked]').size() > 0 && $('form#spaces-dashboard-users select#edit-groups').val() != 0) {
|
| 7 |
$('form#spaces-dashboard-users select#edit-actions').attr('disabled', false);
|
| 8 |
}
|
| 9 |
else {
|
| 10 |
$('form#spaces-dashboard-users select#edit-actions').attr('disabled', true);
|
| 11 |
}
|
| 12 |
}
|
| 13 |
|
| 14 |
Drupal.spaces_dashboard.attach = function () {
|
| 15 |
$('form#spaces-dashboard-users select#edit-groups').change(function() {
|
| 16 |
var gid = $(this).val();
|
| 17 |
if (gid == 0) {
|
| 18 |
$('form#spaces-dashboard-users table tr').removeClass('lit');
|
| 19 |
}
|
| 20 |
else {
|
| 21 |
$('form#spaces-dashboard-users table tr').removeClass('lit');
|
| 22 |
$('form#spaces-dashboard-users table tr.og-'+gid).addClass('lit');
|
| 23 |
}
|
| 24 |
Drupal.spaces_dashboard.setstate();
|
| 25 |
});
|
| 26 |
$('form#spaces-dashboard-users input.form-checkbox').change(function() {
|
| 27 |
Drupal.spaces_dashboard.setstate();
|
| 28 |
});
|
| 29 |
}
|
| 30 |
|
| 31 |
if (Drupal.jsEnabled) {
|
| 32 |
$(document).ready(function() {
|
| 33 |
if ($('form#spaces-dashboard-users').size() > 0) {
|
| 34 |
Drupal.spaces_dashboard.attach();
|
| 35 |
}
|
| 36 |
});
|
| 37 |
};
|