diff --git a/src/view/nav-bar.js b/src/view/nav-bar.js index ca678d5..1ac569a 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, @@ -38,15 +38,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"); @@ -74,13 +69,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; @@ -94,12 +88,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=''; } @@ -122,11 +114,7 @@ export default{


-
-
- -
- +