From 38068824378f746f2a156890354b1fa947c2d5e3 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 17 Mar 2022 22:18:55 +0300 Subject: replace text in buttons with icons --- assets/js/main.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index 0d203dd..84970dc 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -341,18 +341,33 @@ Data.prototype.hide_advanced = function() { }); } +function edit_btn_init(btn) { + btn.empty(); + btn.append(''); +} + +function edit_btn_save(btn) { + btn.empty(); + btn.append(''); +} + function edit_btn_on_click(btn, pre) { var editable = pre.prop('isContentEditable'); pre.prop('contentEditable', !editable); if (editable) { - btn.text('Edit'); + edit_btn_init(btn); btn.blur(); // a.k.a. unfocus } else { - btn.text('Save'); + edit_btn_save(btn); pre.focus(); } } +function dload_btn_init(btn) { + btn.empty(); + btn.append(''); +} + function basename(path) { return path.substring(path.lastIndexOf('/') + 1); } @@ -372,12 +387,14 @@ function dload_btn_on_click(btn, path, pre) { } function make_pre_buttons(path, pre) { - var edit_btn = $('