Skip to content

Commit

Permalink
cleanup duration toggle and makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
eads committed Jun 13, 2012
1 parent 23aeaa2 commit dee661f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 32 deletions.
2 changes: 1 addition & 1 deletion modules/townsquare/townsquare_core/townsquare_core.module
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function townsquare_core_init() {
* Fix silly features incompatibility with theme.
*/
function townsquare_core_custom_theme() {
if (arg(2) == 'features') {
if (arg(2) == 'features' || arg(2) == 'views') {
return 'seven';
}
}
7 changes: 4 additions & 3 deletions modules/townsquare/townsquare_volunteer/js/autocomplete.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Overide Drupal autocomplete methods
(function($) {
/**
(function($) { if (Drupal.jsAC) {

/**
* Handler for the "keydown" event.
*/
Drupal.jsAC.prototype.onkeydown = function (input, e) {
Expand Down Expand Up @@ -115,4 +116,4 @@ Drupal.jsAC.prototype.found = function (matches) {
}
};

})(jQuery);
}})(jQuery);
Original file line number Diff line number Diff line change
Expand Up @@ -24,41 +24,30 @@ Drupal.behaviors.toggleFields = {
$(this).change(function() {
$('input, select, textarea', form)
.not('name="field_session_user[und][0][target_id]"')
.not('name="field_session_duration[und][0][value]"')
.not(':submit')
.removeAttr('readonly');

$('input:checkbox, input:submit, button', form)
.removeAttr('disabled');
});
});
$('.form-item-field-session-override-duration-und input').not(':disabled').each(function() {
var form = $(this).parents('form');
var duration = $('input[name="field_session_duration[und][0][value]"]', form);
var hours = $('.form-item-field-session-hours-und-0-value input, .form-item-field-session-hours-und-0-value2 input', form);
if ($(this).is(':checked')) {
duration.removeAttr('readonly');
hours.attr('readonly', true);
}
else {
duration.attr('readonly', true);
hours.removeAttr('readonly');
}
});
}
};



TownsquareVolunteer = {}
TownsquareVolunteer.toggleDuration = function(field) {
var form = $(field).parents('form');
var duration = $('.field-name-field-session-duration', form);
var hours = $('.form-item-field-session-hours-und-0-value, .form-item-field-session-hours-und-0-value2', form);
var checkbox = $('input:checked', field).not(':disabled'); //.attr('checked');
if (!checkbox.length) {
duration.addClass('form-disabled');
$('input', duration).attr('readonly', true);

hours.removeClass('form-disabled');
$('input', hours).removeAttr('readonly');
$('button', hours).removeAttr('disabled');
} else {
duration.removeClass('form-disabled');
$('input', duration).removeAttr('readonly');

hours.addClass('form-disabled');
$('input', hours).attr('readonly', true);
$('button', hours).attr('disabled', true);
}
}

/* Drupal AJAX overrides */

/**
Expand Down
6 changes: 3 additions & 3 deletions townsquare.make
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ core = 7.x
projects[drupal][type] = core
projects[drupal][version] = "7.12"

projects[addressfield][version] = "1.0-beta2"
projects[addressfield][version] = "1.0-beta3"
projects[addressfield][subdir] = "contrib"

projects[combobox][type] = "module"
Expand All @@ -18,7 +18,7 @@ projects[ctools][subdir] = "contrib"
projects[date][version] = "2.2"
projects[date][subdir] = "contrib"

projects[devel][version] = "1.2"
projects[devel][version] = "1.3"
projects[devel][subdir] = "contrib"

projects[diff][version] = "2.0"
Expand All @@ -27,7 +27,7 @@ projects[diff][subdir] = "contrib"
projects[entity][version] = "1.0-rc1"
projects[entity][subdir] = "contrib"

projects[entityreference][version] = "1.0-rc1"
projects[entityreference][version] = "1.0-rc3"
projects[entityreference][subdir] = "contrib"

projects[eva][version] = "1.1"
Expand Down

0 comments on commit dee661f

Please sign in to comment.