Browse Source

Avoid javascript error in Servers page

pull/717/head
Safihre 9 years ago
parent
commit
49a9fc7682
  1. 14
      interfaces/Config/templates/config_server.tmpl

14
interfaces/Config/templates/config_server.tmpl

@ -249,8 +249,8 @@
this.submit() this.submit()
}) })
}) })
/** /**
Color the priority labels Color the priority labels
**/ **/
// They are already sorted // They are already sorted
@ -268,7 +268,7 @@
\$(this).css('background-color', theColor) \$(this).css('background-color', theColor)
}) })
/** /**
Message on no Default category selected Message on no Default category selected
**/ **/
function checkServerCats() { function checkServerCats() {
@ -279,10 +279,10 @@
// See if this server is enabled // See if this server is enabled
if(!\$(this).parents('.section').find('.col2').hasClass('server-disabled') ) { if(!\$(this).parents('.section').find('.col2').hasClass('server-disabled') ) {
// Is there Default? // Is there Default?
if(\$(this).val().indexOf('Default') > -1) { if(\$(this).val() && \$(this).val().indexOf('Default') > -1) {
// Hide // Hide
\$('.alert-no-category').hide() \$('.alert-no-category').hide()
hasDefault = true hasDefault = true
// All good! // All good!
return true return true
} }
@ -293,8 +293,8 @@
} }
\$('select[name="categories"]').on('change', checkServerCats) \$('select[name="categories"]').on('change', checkServerCats)
checkServerCats() checkServerCats()
/** /**
Click events Click events
**/ **/

Loading…
Cancel
Save