Skip to content

Commit

Permalink
Resolving Issue #2196
Browse files Browse the repository at this point in the history
JavaScript errors when rendering languages using Classic skin plus one
unreported issue in aggregate templates resulting from the same logic
error.
  • Loading branch information
cigamit committed Dec 1, 2018
1 parent 2997d04 commit ba3064d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion aggregate_templates.php
Expand Up @@ -411,7 +411,7 @@ function aggregate_template_edit() {
$('#save_component_template').parent().next('table').css('display', 'none');
} else {
$('#graph_template_id').prop('disabled', true);
if ($('#graph_template_id').selectmenu('widget')) {
if ($('#graph_template_id').selectmenu('instance') !== undefined) {
$('#graph_template_id').selectmenu('disable');
}
}
Expand Down
32 changes: 18 additions & 14 deletions include/layout.js
Expand Up @@ -745,21 +745,25 @@ function applySkin() {
}

function renderLanguages() {
$('select#user_language').selectmenu('destroy').languageselect({
width: '220',
change: function() {
name = $(this).attr('id');
value = $(this).val();
page = basename(location.pathname);
if (page == 'auth_profile.php') {
$.get('auth_profile.php?tab='+currentTab+'&action=update_data&name='+name+'&value='+value, function() {
if (name == 'selected_theme' || name == 'user_language') {
document.location = 'auth_profile.php?action=edit';
}
});
if ($('select#user_language').selectmenu('instance') !== undefined) {
$('select#user_language').selectmenu('destroy');

$('select#user_language').languageselect({
width: '220',
change: function() {
name = $(this).attr('id');
value = $(this).val();
page = basename(location.pathname);
if (page == 'auth_profile.php') {
$.get('auth_profile.php?tab='+currentTab+'&action=update_data&name='+name+'&value='+value, function() {
if (name == 'selected_theme' || name == 'user_language') {
document.location = 'auth_profile.php?action=edit';
}
});
}
}
}
}).languageselect('menuWidget').addClass('ui-menu-icons customicons');
}).languageselect('menuWidget').addClass('ui-menu-icons customicons');
}

$('#user_language-menu').css('max-height', '200px');
}
Expand Down

0 comments on commit ba3064d

Please sign in to comment.