This commit is contained in:
2023-05-05 15:35:58 +08:00
parent 9bf9e7da27
commit 8dafc1c5f4
5 changed files with 88 additions and 82 deletions

View File

@ -255,6 +255,7 @@ class CustomerCommunication {
this.#followers.replaceChildren();
if (followers?.length > 0) {
this.#container.querySelector('.follower-bar').style.display = '';
setTooltip(this.#buttonFollower, r('editFollower', 'Edit Followers'));
this.#container.querySelector('.follower-bar>.bar-list').appendChild(this.#buttonFollower);
for (let f of followers) {
if (f.OptOut) {
@ -297,6 +298,7 @@ class CustomerCommunication {
}
} else {
this.#container.querySelector('.follower-bar').style.display = 'none';
setTooltip(this.#buttonFollower, r('addFollowers', 'Add Followers'));
this.#container.querySelector('.button-edit-contacts').insertAdjacentElement('beforebegin', this.#buttonFollower)
}
this.#message.scrollTop = this.#message.scrollHeight
@ -491,7 +493,7 @@ class CustomerCommunication {
}));
button.addEventListener('click', () => {
const add = new Contact({
company: !nullOrEmpty(this.#data.companyName),
company: !nullOrEmpty(this.#option.companyName),
onSave: item => {
const exists = this.#gridContact.source.some(s => s.Name === item.Name && s.MobilePhone === item.MobilePhone);
if (exists) {
@ -535,19 +537,20 @@ class CustomerCommunication {
}),
createElement('div', null,
createElement('div', div => {
if (nullOrEmpty(this.#data.companyName)) {
if (nullOrEmpty(this.#option.companyName)) {
div.style.display = 'none';
}
div.style.fontWeight = 'bold';
div.innerText = r('contactFromRecord', 'Contacts from Customer Record');
}),
createElement('div', div => {
if (nullOrEmpty(this.#data.companyName)) {
if (nullOrEmpty(this.#option.companyName)) {
div.style.display = 'none';
}
div.className = 'contacts-record';
div.style.maxHeight = '400px';
div.style.width = '660px';
div.style.maxHeight = '200px';
div.style.width = '675px';
div.style.overflow = 'auto';
}),
createElement('div', div => {
div.style.fontWeight = 'bold';
@ -556,7 +559,8 @@ class CustomerCommunication {
createElement('div', div => {
div.className = 'contacts-wo';
div.style.maxHeight = '200px';
div.style.width = '660px';
div.style.width = '675px';
div.style.overflow = 'auto';
})
)
);
@ -564,14 +568,15 @@ class CustomerCommunication {
const selectedCol = This => {
return {
key: 'selected',
type: Grid.ColumnTypes.Checkbox,
type: TooltipCheckboxColumn,
width: 50,
enabled: item => !item.OptOut && !item.OptOut_BC,
onchanged: function () {
if (typeof option.onChanged === 'function') {
option.onChanged([...This.#gridContact.source, ...This.#gridWo.source]);
}
}
},
tooltip: item => item.OptOut ? r('optedOut', 'Opted Out') : r('optedIn', 'Opted In')
}
};
const iconCol = {
@ -606,7 +611,7 @@ class CustomerCommunication {
onclick: function () {
const edit = new Contact({
contact: this,
company: !nullOrEmpty(This.#data.companyName),
company: !nullOrEmpty(This.#option.companyName),
onSave: (item, _op) => {
const exists =
This.#gridContact.source.some(s => s !== this && s.Name === item.Name && s.MobilePhone === item.MobilePhone) ||
@ -871,7 +876,7 @@ class CustomerCommunication {
createElement('div', div => {
div.className = 'followers-record';
div.style.maxHeight = '400px';
div.style.width = '660px';
div.style.width = '675px';
div.style.overflow = 'auto';
})
)

View File

@ -196,11 +196,14 @@
> textarea {
padding: 10px 10px 0;
border: none;
border: 1px solid var(--title-bg-color);
border-radius: 5px;
height: 70px;
resize: none;
font-size: var(--font-smaller-size);
font-family: var(--font-family);
margin: 3px 5px;
background: #f0f0f0;
@include outline();
}