Skip to content

Commit

Permalink
Add popover menu for purpose of checking methods. #603
Browse files Browse the repository at this point in the history
  • Loading branch information
suntala committed Sep 25, 2018
1 parent dbde66f commit 38896f1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 20 deletions.
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions src/components/ContactDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
<contact-avatar :contact="contact" />
<!-- QUESTION: is it better to pass contact as a prop or get it from the store inside
contact-avatar ? :avatar="contact.photo"-->
<!-- temporary popover menu for the purpose of testing methods (WIP, to be deleted) -->
<div :class="{open: true}" class="popovermenu">
<popover-menu :menu="menu" />
</div>

<!-- fullname, org, title -->
<div id="contact-header-infos">
Expand Down Expand Up @@ -237,6 +241,23 @@ export default {
localContact.updateContact(contact.jCal)
return localContact
}
},

// building the popover menu for the avatar (WIP, to be deleted)
menu() {
let menu = [
{
icon: 'icon-download',
text: t('contacts', 'Download')
// action: this.deleteContact
},
{
icon: 'icon-delete',
text: t('contacts', 'Delete')
// action: this.deleteContact
}
]
return menu
}
},

Expand Down
7 changes: 4 additions & 3 deletions src/components/ContactDetails/ContactDetailsAvatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import rfcProps from '../../models/rfcProps';
<div id="contact-header-avatar" :class="{'maximised':maximizeAvatar }">
<div class="contact-avatar-background" />
<img v-if="contact.photo" :src="contact.photo"
class="contact-header-avatar__picture"
@click="maximise">
class="contact-header-avatar__picture">
<div class="avatar-options">
<input id="contact-avatar-upload" type="file" class="hidden"
accept="image/*" @change="processFile">
Expand All @@ -37,6 +36,8 @@ import rfcProps from '../../models/rfcProps';
</div>
</div>
</template>
// TODO: add back @click="maximise" to img tag
// delete the new code in ContactDetails tagged with WIP, to be deleted

<script>

Expand Down Expand Up @@ -68,7 +69,7 @@ export default {
},
toggleSize() {
// maximise avatar photo
this.maximizeAvatar != this.maximizeAvatar
this.maximizeAvatar = !this.maximizeAvatar
},
removePhoto() {
// self.contact.vCard.removePropertyWithValue('photo', reader.result)
Expand Down

0 comments on commit 38896f1

Please sign in to comment.