Advertisement
Guest User

Weird Bug

a guest
Nov 29th, 2015
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private moveUp(competence: Models.Competence) {
  2.             var id = this.getIdinParentChilds(competence);
  3.             if (id > 0) {
  4.                 var childs = competence.parent.children;
  5.                 childs.splice(id, 1);
  6.                 var comp = new Models.Competence(competence.id, competence.description, competence.parent, competence.children);
  7.                 comp.edit = true;
  8.                 childs.splice(id - 1, 0, comp);
  9.             }
  10.         }
  11.  
  12.         private moveDown(competence: Models.Competence) {
  13.             var childs = competence.parent.children;
  14.             var id = this.getIdinParentChilds(competence);
  15.             if (id < childs.length - 1) {
  16.                 childs.splice(id, 1);
  17.                 childs.splice(id + 1, 0, competence);
  18.             }
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement