diff --git a/components/section_skills.js b/components/section_skills.js index f18466e..e2a7dc9 100644 --- a/components/section_skills.js +++ b/components/section_skills.js @@ -37,6 +37,9 @@ var sectionSkillsComponent = { { var item = models.newDefaultSkillKeyword(); //console.log("addHighlight(" + index + ")", this.$root.sections.volunteer[index]); + if (!this.$root.sections.skills[index].keywords) { + this.$set(this.$root.sections.skills[index], "keywords", []); + } this.$root.sections.skills[index].keywords.push(item); }, diff --git a/components/section_volunteer.js b/components/section_volunteer.js index cdc4bfb..b5cf243 100644 --- a/components/section_volunteer.js +++ b/components/section_volunteer.js @@ -36,7 +36,10 @@ var sectionVolunteerComponent = { addHighlight: function(index) { var item = models.newDefaultVolunteerHighlight(); - //console.log("addHighlight(" + index + ")", this.$root.sections.volunteer[index]); + console.log("addHighlight(" + index + ")", this.$root.sections.volunteer[index]); + if (!this.$root.sections.volunteer[index].highlights) { + this.$set(this.$root.sections.volunteer[index], "highlights", []); + } this.$root.sections.volunteer[index].highlights.push(item); }, diff --git a/components/section_work.js b/components/section_work.js index 940b7ba..ecd9fa6 100644 --- a/components/section_work.js +++ b/components/section_work.js @@ -35,10 +35,22 @@ var sectionWorkComponent = { addHighlight: function(index) { + if (!this.$root.sections.work[index].highlights) { + this.$set(this.$root.sections.work[index], "highlights", []); + } var item = models.newDefaultWorkHighlight(); 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) { @@ -60,6 +72,19 @@ var sectionWorkComponent = { moveDownClicked: function(index) { this.$root.moveArrayPosition(this.$root.sections.work, index, index + 1); + }, + + moveUpClickedHighlight: function(wIndex,index) + { + if (index > 0) + this.$root.moveArrayPosition(this.$root.sections.work[wIndex].highlights, index, index - 1); + }, + + + moveDownClickedHighlight: function(wIndex,index) + { + if (index < this.$root.sections.work[wIndex].highlights.length) + this.$root.moveArrayPosition(this.$root.sections.work[wIndex].highlights, index, index + 1); } } }; \ No newline at end of file diff --git a/index.html b/index.html index f32b49a..b1df5d8 100644 --- a/index.html +++ b/index.html @@ -366,6 +366,9 @@
  1. + + +
@@ -872,7 +875,6 @@ Briefly describe successes and outcomes (e.g. Increased profits by 20% from 2011-2012 through viral advertising). - X: {{project.highlights.length}}
  1. @@ -999,7 +1001,7 @@

    Work

    -
    +
    {{work.position}}
    {{work.company}}