mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
[fix] JS error with undefined variables.
This commit is contained in:
parent
07fb6e5435
commit
132b79e8d5
1 changed files with 3 additions and 3 deletions
|
@ -7,14 +7,14 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
, addMaildrop = document.getElementById('add-maildrop')
|
||||
;
|
||||
|
||||
[].forEach.call(liMenu, function(el, i) {
|
||||
liMenu && [].forEach.call(liMenu, function(el, i) {
|
||||
// Add color class.
|
||||
el.classList.add(colors[i%colors.length]);
|
||||
// Set first-letter data attribute.
|
||||
el.querySelector('.first-letter').setAttribute('data-first-letter',el.textContent.substring(0, 2));
|
||||
});
|
||||
|
||||
addMailAlias.addEventListener('click', function(){
|
||||
addMailAlias && addMailAlias.addEventListener('click', function(){
|
||||
// Clone last input.
|
||||
var inputAliasClone = document.querySelector('.mailalias-input').cloneNode(true);
|
||||
// Empty value.
|
||||
|
@ -23,7 +23,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
addMailAlias.parentNode.insertBefore(inputAliasClone, addMailAlias);
|
||||
});
|
||||
|
||||
addMaildrop.addEventListener('click', function(){
|
||||
addMaildrop && addMaildrop.addEventListener('click', function(){
|
||||
// Clone last input.
|
||||
var inputDropClone = document.querySelector('.maildrop-input').cloneNode(true);
|
||||
// Empty value.
|
||||
|
|
Loading…
Add table
Reference in a new issue