From 86afd151007f0b57bb0f513cf3190f2e913bb8d4 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 21 Oct 2021 19:43:16 +0530 Subject: [PATCH] fix: Revert back to text buttons --- .../print_format_builder.bundle.js | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/frappe/public/js/print_format_builder/print_format_builder.bundle.js b/frappe/public/js/print_format_builder/print_format_builder.bundle.js index 1d18a15c3f..b2d3372daf 100644 --- a/frappe/public/js/print_format_builder/print_format_builder.bundle.js +++ b/frappe/public/js/print_format_builder/print_format_builder.bundle.js @@ -15,21 +15,21 @@ class PrintFormatBuilder { this.page.set_primary_action(__("Save"), () => { this.$component.$store.save_changes(); }); - let $toggle_preview_btn = this.page.add_action_icon( - "printer", - () => this.$component.toggle_preview(), - "", - __("Toggle Preview") + let $toggle_preview_btn = this.page.add_button( + __("Show Preview"), + () => { + this.$component.toggle_preview(); + } ); - this.page.add_action_icon( - "refresh", - () => this.$component.$store.reset_changes(), - "", - __("Reset Changes") + this.page.add_button(__("Reset Changes"), () => + this.$component.$store.reset_changes() ); this.page.add_menu_item(__("Edit Print Format"), () => { frappe.set_route("Form", "Print Format", this.print_format); }); + this.page.add_menu_item(__("Change Print Format"), () => { + frappe.set_route("print-format-builder-beta"); + }); let $vm = new Vue({ el: this.$wrapper.get(0), @@ -51,6 +51,11 @@ class PrintFormatBuilder { $toggle_preview_btn.show(); } }); + this.$component.$watch("show_preview", value => { + $toggle_preview_btn.text( + value ? __("Hide Preview") : __("Show Preview") + ); + }); } }