From 7dfa0731b4afdbb84a540940b7323fe426507a19 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 21 Nov 2023 15:26:13 +0000 Subject: [PATCH] Bug 35134: Make cn_browser popup responsive to screen size To test: 1. Use the cn_browser.pl plugin for the 952$o ( call number ) 2. Add or edit an item and select the `...` to the right of the call number field. 3. The pop-up is hardcoded as 500px x 400px pop-up. 4. APPLY PATCH 5. Clear browser cache and try again. The window width should now be half of the current screen size. The window height should be 100% of the screen height. --- cataloguing/value_builder/cn_browser.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cataloguing/value_builder/cn_browser.pl b/cataloguing/value_builder/cn_browser.pl index 55128fc7bc3..881103c8f82 100755 --- a/cataloguing/value_builder/cn_browser.pl +++ b/cataloguing/value_builder/cn_browser.pl @@ -35,8 +35,10 @@ my $builder = sub { function Click$function_name(ev) { ev.preventDefault(); + let window_width = screen.width / 2; + let window_height = screen.height; q = document.getElementById(ev.data.id); - window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=cn_browser.pl&popup&q=\"+encodeURIComponent(q.value),\"cnbrowser\",\"width=500,height=400,toolbar=false,scrollbars=yes\"); + window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=cn_browser.pl&popup&q=\"+encodeURIComponent(q.value),\"cnbrowser\",\"width=\"+window_width+\"\,height=\"+window_height+\"\,toolbar=false,scrollbars=yes\"); } -- 2.30.2