fix(timeline)

This commit is contained in:
Rushabh Mehta 2018-10-02 10:40:27 +05:30
parent 98abda32b4
commit 0e65150b87
3 changed files with 13 additions and 13 deletions

View file

@ -2,7 +2,7 @@
<div class="timeline-head">
</div>
<div class="timeline-new-email">
{% if(doctype === "Communication") { %}
{% if (doctype === "Communication") { %}
<button class="btn btn-default btn-reply-email btn-xs">
{%= __("Reply") %}
</button>
@ -10,7 +10,7 @@
<button class="btn btn-default btn-new-email btn-xs">
{%= __("New Email") %}
</button>
{% if(allow_events_in_timeline===1) { %}
{% if (allow_events_in_timeline===1) { %}
<button class="btn btn-default btn-new-interaction btn-xs">
{%= __("New Event") %}
</button>

View file

@ -111,7 +111,7 @@ frappe.ui.form.Timeline = class Timeline {
recipients: me.get_recipient()
}
$.extend(args, {
txt: frappe.markdown(me.comment_area.val())
txt: frappe.markdown(me.comment_area.get_value())
});
new frappe.views.InteractionComposer(args);
});
@ -152,7 +152,7 @@ frappe.ui.form.Timeline = class Timeline {
me.render_timeline_item(d);
});
// more btn
if (this.more===undefined && timeline.length===20) {
@ -203,7 +203,7 @@ frappe.ui.form.Timeline = class Timeline {
only_input: true,
no_wrapper: true
});
},
}
render_timeline_item(c) {
var me = this;
@ -696,7 +696,7 @@ frappe.ui.form.Timeline = class Timeline {
}
get_recipient() {
if(this.frm.email_field) {
if (this.frm.email_field) {
return this.frm.doc[this.frm.email_field];
} else {
return this.frm.doc.email_id || this.frm.doc.email || "";

View file

@ -49,7 +49,7 @@ frappe.views.InteractionComposer = class InteractionComposer {
let me = this;
let interaction_docs = Object.keys(get_doc_mappings());
let fields= [
let fields = [
{label:__("Reference"), fieldtype:"Select",
fieldname:"interaction_type", options: interaction_docs,
reqd: 1,
@ -85,7 +85,7 @@ frappe.views.InteractionComposer = class InteractionComposer {
];
return fields;
}
get_event_categories() {
@ -128,8 +128,8 @@ frappe.views.InteractionComposer = class InteractionComposer {
from_form: 1,
folder:"Home/Attachments"
},
callback: function(attachment){
me.attachments.push(attachment);
callback: function(attachment){
me.attachments.push(attachment);
},
max_width: null,
max_height: null
@ -224,12 +224,12 @@ frappe.views.InteractionComposer = class InteractionComposer {
Object.keys(form_values).forEach(value => {
interaction_values[field_map[form_values.interaction_type]["field_map"][value]] = form_values[value];
});
if ("event_type" in interaction_values){
interaction_values["event_type"] = (form_values.public == 1) ? "Public" : "Private";
}
if (interaction_values["doctype"] == "Event") {
interaction_values["event_participants"] = [{"reference_doctype": form_values.reference_doctype,
interaction_values["event_participants"] = [{"reference_doctype": form_values.reference_doctype,
"reference_docname": form_values.reference_document}];
}
if (!("owner" in interaction_values)){
@ -292,7 +292,7 @@ frappe.views.InteractionComposer = class InteractionComposer {
}
});
}
}
add_attachments(doc, attachments) {