Skip to content

Commit

Permalink
Closes #42, Closes #41
Browse files Browse the repository at this point in the history
  • Loading branch information
Lomilar committed May 16, 2019
1 parent 19a8601 commit 0d440ce
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
10 changes: 7 additions & 3 deletions js/controls/people.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Vue.component('people', {
search: ""
};
},
computed: {
recomputed: {
people: {
get: function () {
if (app.people == null) return null;
Expand All @@ -17,7 +17,7 @@ Vue.component('people', {
continue;
if (app.people[i].getName() == null)
continue;
if (app.people[i].getName().toLowerCase().indexOf(this.search.toLowerCase()) != -1)
if (this.search == "" || app.people[i].getName().toLowerCase().indexOf(this.search.toLowerCase()) != -1)
results.push(app.people[i]);
}
return results;
Expand All @@ -38,7 +38,11 @@ Vue.component('people', {
size: 5000
});
},
watch: {},
watch: {
search: function(newSearch){
this.$recompute("people");
}
},
methods: {
changeSelected: function (pk) {
app.subject = pk;
Expand Down
25 changes: 15 additions & 10 deletions js/controls/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Vue.component('profile', {
inContactList: null
}
},
computed: {
recomputed:{
person: {
get: function () {
if (this.personObj != null)
Expand All @@ -20,9 +20,13 @@ Vue.component('profile', {
return null;
},
set: function(person){
this.personObj = person;
this.personObj = person;
this.$recompute("person");
}
},
}

},
computed: {
name: {
get: function () {
if (this.person == null)
Expand Down Expand Up @@ -135,6 +139,7 @@ Vue.component('profile', {
if (p.seeks == null)
p.seeks = [];
this.personObj = p;
this.$recompute("person");
if (this.pk == app.subject)
app.subjectPerson = p;
if (this.pk == app.me)
Expand Down Expand Up @@ -276,18 +281,18 @@ Vue.component('profile', {
template: '<div class="profileRow" v-if="person">' +
'<span v-if="mine">' +
'<span v-if="editing">' +
'<i class="mdi mdi-content-save" aria-hidden="true" style="float:right;font-size:large" title="Save your person." v-on:click="savePerson()"></i>' +
'<i class="mdi mdi-cancel" aria-hidden="true" style="float:right;font-size:large" title="Cancel editing." v-on:click="cancelSave();"></i>' +
'<i class="mdi mdi-content-save mdi-36px" aria-hidden="true" style="float:right;font-size:large" title="Save your personal information." v-on:click="savePerson()"></i>' +
'<i class="mdi mdi-cancel mdi-36px" aria-hidden="true" style="float:right;font-size:large" title="Cancel editing." v-on:click="cancelSave();"></i>' +
'</span>' +
'<span v-else>' +
'<i class="mdi mdi-pencil" aria-hidden="true" style="float:right;font-size:large" title="Edit your person." v-on:click="editing = true;"></i>' +
'<i class="mdi mdi-pencil mdi-36px" aria-hidden="true" style="float:right;font-size:large" title="Edit your personal information." v-on:click="editing = true;"></i>' +
'</span>' +
'</span>' +
'<span v-else>' +
'<i class="mdi mdi-account-circle" aria-hidden="true" style="float:right;font-size:large" title="Remove person from contacts." v-if="isContact" v-on:click="uncontact();"></i> ' +
'<i class="mdi mdi-account-circle-outline" aria-hidden="true" style="float:right;font-size:large" title="Add person to contacts." v-else v-on:click="contact();"></i> ' +
'<i class="mdi mdi-comment-processing-outline" aria-hidden="true" style="float:right;font-size:large" :title="unshareStatement" v-if="isSubject == false" v-on:click="unshareAssertionsAboutSubjectWith();"></i> ' +
'<i class="mdi mdi-comment-account" aria-hidden="true" style="float:right;font-size:large" :title="shareStatement" v-if="isSubject == false" v-on:click="shareAssertionsAboutSubjectWith();"></i> ' +
'<i class="mdi mdi-account-circle mdi-36px" aria-hidden="true" style="float:right;font-size:large" title="Remove person from contacts." v-if="isContact" v-on:click="uncontact();"></i> ' +
'<i class="mdi mdi-account-circle-outline mdi-36px" aria-hidden="true" style="float:right;font-size:large" title="Add person to contacts." v-else v-on:click="contact();"></i> ' +
'<i class="mdi mdi-comment-processing-outline mdi-36px" aria-hidden="true" style="float:right;font-size:large" :title="unshareStatement" v-if="isSubject == false" v-on:click="unshareAssertionsAboutSubjectWith();"></i> ' +
'<i class="mdi mdi-comment-account mdi-36px" aria-hidden="true" style="float:right;font-size:large" :title="shareStatement" v-if="isSubject == false" v-on:click="shareAssertionsAboutSubjectWith();"></i> ' +
'</span>' +
'<img style="vertical-align: sub;" v-if="fingerprintUrl" :src="fingerprintUrl" :title="fingerprint"/>'+
'<svg v-else style="vertical-align: sub;" width="44" height="44" :data-jdenticon-value="fingerprint" :title="fingerprint"></svg>'+
Expand Down
2 changes: 2 additions & 0 deletions js/vendor/vue-recomputed.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Vue.mixin({
this$1.$options.computed[key] = function (vm) {
/* eslint-disable-next-line */
data[me][key];
if (EcObject.isObject(this$1.$options.recomputed[key]))
return this$1.$options.recomputed[key].get.call(vm, vm)
return this$1.$options.recomputed[key].call(vm, vm)
};
});
Expand Down

0 comments on commit 0d440ce

Please sign in to comment.