From 8aae19686b2c8a8ae66fab083cc2fa8da435016f Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Mon, 11 Dec 2017 06:38:56 +0000 Subject: [PATCH] This partially addresses #43. --- Connections/database_functions.php | 4 +-- shop_log.php | 39 +++++++++++++++++------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/Connections/database_functions.php b/Connections/database_functions.php index 25f1076..26b0deb 100644 --- a/Connections/database_functions.php +++ b/Connections/database_functions.php @@ -281,9 +281,9 @@ define('SHOW_SHOP_ID',0); **************/ // Allow comments/feedback/notes to be added per individual_history_log in reports, // and globally in shop_log. An etherpad host has to be defined for this to work. -// See wiki for instructions on how to setup an etherpad docker instance.r +// See wiki for instructions on how to setup an etherpad docker instance. // -// prefix allows you to set a prefix to the name of the autogenerated padID: +// prefix allows you to set a prefix to the name of the autogenerated padId: // etherpad = prefix + "pad_contact_id_" + contact_id; // etherpad_global = prefix_ + "global_pad" // See https://github.com/ether/etherpad-lite-jquery-plugin for information about other configurations. diff --git a/shop_log.php b/shop_log.php index bb9a72c..14ae884 100644 --- a/shop_log.php +++ b/shop_log.php @@ -76,28 +76,33 @@ if($_GET['new_user_id']>0){ $( window ).on( "load", function() { - var body_margin = $("#shop_log_iframe").contents().find("body").css("margin"); - body_margin = body_margin.replace("px",""); - body_margin = body_margin * 4; - var shop_log_height = $("#shop_log_iframe").contents().find("#shop_height").height() + - $("#shop_log_iframe").contents().find("#header_height").height() + body_margin; - - $("#shop_log_iframe").css({"height": shop_log_height}); - - $("#shop_log_iframe").contents().find("#shop_log_link").attr("href","/shop_log_iframe.php"); - - // does this work? - $("#shop_log_iframe").contents().find("#sign_in_button").on("click keypress", function(e){ - + if ( $("#epframeshop_log_pad").length ) { + + var body_margin = $("#shop_log_iframe").contents().find("body").css("margin"); body_margin = body_margin.replace("px",""); body_margin = body_margin * 4; var shop_log_height = $("#shop_log_iframe").contents().find("#shop_height").height() + $("#shop_log_iframe").contents().find("#header_height").height() + body_margin; - - $("#shop_log_iframe").css({"height": shop_log_height}); - - }); + + $("#shop_log_iframe").css({"height": shop_log_height}); + + $("#shop_log_iframe").contents().find("#shop_log_link").attr("href","/shop_log_iframe.php"); + + // does this work? + $("#shop_log_iframe").contents().find("#sign_in_button").on("click keypress", function(e){ + + var body_margin = $("#shop_log_iframe").contents().find("body").css("margin"); + body_margin = body_margin.replace("px",""); + body_margin = body_margin * 4; + var shop_log_height = $("#shop_log_iframe").contents().find("#shop_height").height() + + $("#shop_log_iframe").contents().find("#header_height").height() + body_margin; + + $("#shop_log_iframe").css({"height": shop_log_height}); + + }); + + } // if etherpad }); // end $( window ).on