blob: 6cb1207e79eaf2d76996329513426a13da9206e7 [file] [log] [blame]
Leela vadlamudia3845a92020-12-01 13:04:53 +05301frappe.ui.form.ControlData = frappe.ui.form.ControlData.extend( {
2 make_input() {
3 this._super();
4 if (this.df.options == 'Phone') {
5 this.setup_phone();
6 }
7 },
8 setup_phone() {
9 if (frappe.phone_call.handler) {
10 this.$wrapper.find('.control-input')
11 .append(`
12 <span class="phone-btn">
13 <a class="btn-open no-decoration" title="${__('Make a call')}">
Shivam Mishra46bc7ca2020-12-22 12:32:13 +053014 ${frappe.utils.icon('call')}
Leela vadlamudia3845a92020-12-01 13:04:53 +053015 </span>
16 `)
17 .find('.phone-btn')
18 .click(() => {
19 frappe.phone_call.handler(this.get_value(), this.frm);
20 });
21 }
22 }
Leela vadlamudi29778e22020-12-15 21:23:17 +053023});