2
0
mirror of https://github.com/frappe/books.git synced 2025-02-02 20:18:26 +00:00

FollowLink as input group

This commit is contained in:
Faris Ansari 2018-07-16 17:33:59 +05:30
parent f5cdbfa620
commit 15233a9273

View File

@ -52,11 +52,20 @@ export default {
}, },
[ [
this.getLabelElement(h), this.getLabelElement(h),
this.getInputElement(h), this.getInputGroupElement(h)
this.getFollowLink(h)
] ]
); );
}, },
getInputGroupElement(h) {
return h('div', {
class: ['input-group']
}, [
this.getInputElement(h),
h('div', {
class: ['input-group-append']
}, [this.getFollowLink(h)])
]);
},
getFollowLink(h) { getFollowLink(h) {
const doctype = this.getTarget(); const doctype = this.getTarget();
const name = this.value; const name = this.value;
@ -65,23 +74,27 @@ export default {
return null; return null;
} }
return h(FeatherIcon, { const arrow = h(FeatherIcon, {
props: { props: {
name: 'arrow-right-circle' name: 'arrow-right'
}, },
class: ['text-muted'], class: ['text-muted'],
style: { style: {
position: 'absolute', height: '16px'
right: '8px', }
bottom: '4px', });
cursor: 'pointer'
return h('button', {
class: ['btn btn-sm btn-outline-light border d-flex'],
attrs: {
type: 'button'
}, },
nativeOn: { on: {
click: () => { click: () => {
this.$router.push(`/edit/${doctype}/${name}`); this.$router.push(`/edit/${doctype}/${name}`);
} }
} }
}); }, [arrow])
}, },
getTarget() { getTarget() {
return this.docfield.target; return this.docfield.target;