diff --git a/src/view/nav-bar.js b/src/view/nav-bar.js index fb8fc56..7314259 100644 --- a/src/view/nav-bar.js +++ b/src/view/nav-bar.js @@ -3,7 +3,7 @@ export default{ return { teams:[], news: [], - id:'', + id: 1, name:'', description:'', teamClicked: false, @@ -39,15 +39,10 @@ export default{ }, checkFields: function() { this.errMessage=""; - document.querySelector("#id").removeAttribute("style"); document.querySelector("#name").removeAttribute("style"); document.querySelector("#desc").removeAttribute("style"); - if(this.id===""||this.name===""||this.description===""){ + if(this.name===""||this.description===""){ this.errMessage+="The"; - if(this.id===""){ - this.errMessage+=" id"; - document.querySelector("#id").setAttribute("style","border: 1px solid #d66"); - } if(this.name===""){ this.errMessage+=" name"; document.querySelector("#name").setAttribute("style","border: 1px solid #d66"); @@ -75,13 +70,12 @@ export default{ console.log(team); if(!this.edit){//adding a team this.teams.push(team); - this.id=''; this.name=''; this.description=''; + this.id=this.id+1 } else{//editing a team this.teams[this.idxEdit]=team; - this.id=''; this.name=''; this.description=''; this.edit=false; @@ -95,12 +89,10 @@ export default{ } }); if(this.edit){ - this.id=team.id; this.name=team.name ; this.description=team.description; } else{ - this.id=''; this.name=''; this.description=''; } @@ -123,11 +115,7 @@ export default{


-
-
- -
- +