diff --git a/app/app.js b/app/app.js index 247b711..9e3bbca 100644 --- a/app/app.js +++ b/app/app.js @@ -448,6 +448,7 @@ var app = new Vue({ */ moveArrayPosition: function(arr, old_index, new_index) { + if (new_index == old_index) { // No change @@ -457,7 +458,7 @@ var app = new Vue({ if (new_index > old_index) { // Moving forward in array - if (old_index == this.$root.sections.work.length - 1) return; // Cannot move beyond the end of the array + if (old_index == arr - 1) return; // Cannot move beyond the end of the array } if (new_index < old_index) { @@ -475,6 +476,8 @@ var app = new Vue({ } } + + arr.splice(new_index, 0, arr.splice(old_index, 1)[0]); return arr; // for testing diff --git a/components/section_education.js b/components/section_education.js index 493c7ce..0fd0bc1 100644 --- a/components/section_education.js +++ b/components/section_education.js @@ -1,8 +1,6 @@ var sectionEducationComponent = { template: '#section-education-template', - - mounted: function() { @@ -60,6 +58,30 @@ var sectionEducationComponent = { moveDownClicked: function(index) { this.$root.moveArrayPosition(this.$root.sections.education, index, index + 1); + }, + + deleteClickedCourse: function(eIndex, index) + { + var response = confirm("Are you sure you want to delete this Course?"); + + if (response == true) + { + this.$root.sections.education[eIndex].courses.splice(index, 1); + } + }, + + moveUpClickedCourse: function(eIndex,index) + { + if (index > 0) + this.$root.moveArrayPosition(this.$root.sections.education[eIndex].courses, index, index - 1); + }, + + + moveDownClickedCourse: function(eIndex,index) + { + if (index < this.$root.sections.education[eIndex].courses.length) + this.$root.moveArrayPosition(this.$root.sections.education[eIndex].courses, index, index + 1); } + } }; \ No newline at end of file diff --git a/components/section_work.js b/components/section_work.js index ecd9fa6..26b676f 100644 --- a/components/section_work.js +++ b/components/section_work.js @@ -42,16 +42,6 @@ var sectionWorkComponent = { this.$root.sections.work[index].highlights.push(item); }, - deleteClickedHighlight: function(wIndex, index) - { - var response = confirm("Are you sure you want to delete this highlight?"); - - if (response == true) - { - this.$root.sections.work[wIndex].highlights.splice(index, 1); - } - }, - deleteClicked: function(index) { var response = confirm("Are you sure you want to delete this position?"); @@ -74,6 +64,16 @@ var sectionWorkComponent = { this.$root.moveArrayPosition(this.$root.sections.work, index, index + 1); }, + deleteClickedHighlight: function(wIndex, index) + { + var response = confirm("Are you sure you want to delete this highlight?"); + + if (response == true) + { + this.$root.sections.work[wIndex].highlights.splice(index, 1); + } + }, + moveUpClickedHighlight: function(wIndex,index) { if (index > 0) diff --git a/components/simple_list_item.js b/components/simple_list_item.js new file mode 100644 index 0000000..3e4338d --- /dev/null +++ b/components/simple_list_item.js @@ -0,0 +1,63 @@ +Vue.component("simple-list-item", { + template: '#simple-list-item-template', + + + props: [ + 'modelitem', + 'id' + ], + + + + + mounted: function() + { + this.displayFormat = (this.format ? this.format : ""); + }, + + + + destroyed: function() + { + + }, + + + + data: function() + { + return { + + }; + }, + + + + methods: { + getModelItem: function() + { + return (this.modelitem ? this.modelitem : "???"); + }, + + + deleteClick: function() + { + //alert("deleteClick"); + this.$emit('delete-clicked', this.id); + }, + + + moveUpClick: function() + { + //alert("moveUpClick"); + this.$emit('move-up-clicked', this.id); + }, + + + moveDownClick: function() + { + //alert("moveDownClick"); + this.$emit('move-down-clicked', this.id); + }, + } +}); \ No newline at end of file diff --git a/index.html b/index.html index eb4f7f9..3ba796e 100644 --- a/index.html +++ b/index.html @@ -373,14 +373,25 @@ Briefly describe successes and outcomes (e.g. Increased profits by 20% from 2011-2012 through viral advertising). -
    -
  1. - - - - -
  2. -
+ + + +
+ +
+ + @@ -525,11 +536,11 @@ List notable courses/subjects (e.g. H1302 - Introduction to American history). -
    -
  1. - -
  2. -
+ + +
+ +
@@ -1244,6 +1255,22 @@ + +