blob: f9caadeed7f0c8bbb1a65566108b0adb77c04ef3 [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')}">
14 <i class="fa fa-phone"></i></a>
15 </span>
16 `)
17 .find('.phone-btn')
18 .click(() => {
19 frappe.phone_call.handler(this.get_value(), this.frm);
20 });
21 }
22 }
Leela vadlamudidf9144c2020-12-15 21:23:17 +053023});