How to use the foundation-sites.Reveal function in foundation-sites

To help you get started, we’ve selected a few foundation-sites examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github decidim / decidim / decidim-core / app / packs / src / decidim / session_timeouter.js View on Github external
$(() => {
  const $timeoutModal = $("#timeoutModal");
  const timeoutInSeconds = parseInt($timeoutModal.data("session-timeout"), 10);
  const secondsUntilTimeoutPath = $timeoutModal.data("seconds-until-timeout-path");
  const interval = $timeoutModal.data("session-timeouter-interval");
  let endsAt = moment().add(timeoutInSeconds, "seconds");
  const popup = new Foundation.Reveal($timeoutModal);
  const $continueSessionButton = $("#continueSession");

  // Ajax request is made at timeout_modal.html.erb
  $continueSessionButton.on("click", () => {
    $("#timeoutModal").foundation("close")
    // In admin panel we have to hide all overlays
    $(".reveal-overlay").css("display", "none");
  })

  if (!timeoutInSeconds) {
    return;
  }

  const setTimer = (secondsUntilExpiration) => {
    if (!secondsUntilExpiration) {
      return;
github waqastudios / inti-foundation / library / src / js / inti.js View on Github external
$(document).ready(function(){

	// Create the Reveal modal for the initial cookie message
	var $cookiemodal = new Foundation.Reveal($('#inti-cookie-policy'), {
		vOffset: 'auto',
		// overlay: false,
		closeOnClick: false

	});

	// Next, check to see if the visitor has been here before, if they have,
	// they'll have the needed-cookies cookie, if not it'll be undefined
	if (typeof Cookies.get('needed-cookies') === "undefined" || typeof Cookies.get('functional-cookies') === "undefined") {
		// First time visitor
		// Open cookie message modal
		$cookiemodal.open();

		// Set initial recommended cookie settings for 1 minute
		Cookies.set('needed-cookies', true, { expires: 1/24/60 });
		Cookies.set('functional-cookies', true, { expires: 1/24/60 });