Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log-tail script still running if log shown in modal window and the window is closed #13

Open
ReddySk opened this issue Feb 21, 2017 · 1 comment

Comments

@ReddySk
Copy link

ReddySk commented Feb 21, 2017

Hello,

I am opening the log-tail page in modal window using bootstrap.

Problem is that even if the modal window is closed and even if I used to remove data from closed modal by following script which works for all my modal windows opened by link the script to seems stay active and still invoking ajax to the log file:

	<script type="text/javascript">
		$('.modal').on('hidden.bs.modal', function () {
			  $(this).removeData('bs.modal');
		}); 
	</script>

Please advise solution.

Thanks, Reddy

@danielrichman
Copy link
Member

Well, logtail.js kind of assumes it owns the page in more ways than just that: it tries to scroll the whole page, it adds a global window.onerror handler, etc. So the way I see it, you have two options:

  • change the scrolling behaviour, make it only catch its own exceptions, don't call get_log on page load, and---to address your specific question---add the event handler for hiding the modal that sets the "kill" variable to true (then add a handler for showing the modal that unsets kill, resets the variables, and calls get_log)
  • run it in an iframe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants