Skip to content

Commit

Permalink
Fixed Topic Control javascript to work with latest version of jQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
eSilverStrike committed Dec 12, 2016
1 parent 0d867eb commit c8ae599
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public_html/javascript/topic_control.js
Expand Up @@ -73,13 +73,13 @@ var onTopicChange = function () {
select_default_tid.val('');

// If the option is only one, set to that value
if (options_default.size() == 1) {
if (options_default.length == 1) {
options_default.eq(0).attr('selected', true);
select_default_tid.val(options_default.eq(0).val());
} else {
// Set Selection as before if still exist
var last_option = options_default.filter('[value="' + prev_default_tid + '"]');
if (last_option.size() == 1) {
if (last_option.length == 1) {
last_option.attr('selected', true);
select_default_tid.val(prev_default_tid);
}
Expand All @@ -105,7 +105,7 @@ function changeTopicControlDisplay() {
$('#panel_topic_options').css('display', $display);
}

$display = ($('#tid option:selected').size() == 0)
$display = ($('#tid option:selected').length == 0)
? 'none' : 'inline-block';
if ($('#panel_radio_options').is(':visible') && !$('#topic_option_selectedtopics').is(':checked')) {
$display = 'none';
Expand Down

0 comments on commit c8ae599

Please sign in to comment.