2A News

Court Rules Employees Can’t Be Fired for Defending Themselves

Reading Time: 2:9 min

Anyone who browses social media can easily find innumerable examples of belligerent customers harassing employees everywhere from convenience stores to international airports. And some cross the line. For too long,…

View post

Appeals Court Returns Concealed Carry Rights to Young Adults in Florida

Reading Time: 2:9 min

The Florida Fourth District Court of Appeals on Wednesday determined that the state’s prohibition of young adults exercising concealed carry rights infringes on Second Amendment protections. The court determined that…

View post

Gun Rights Opponents Blame Retailer for Trump Assassination Attempt

Reading Time: 2:16 min

The most recent attempt on President Donald Trump’s (R) life came from an obviously disturbed individual who took a train from the West Coast only to be stymied at the…

View post

SCOTUS: Marijuana Use Does Not Negate Gun Rights

Reading Time: 3:54 min

The U.S. Supreme Court on Thursday sided with sanity on the issue of gun possession and marijuana use. The outcome of US v. Hemani is welcome news as the high…

View post

Cornyn Unveils Legislation to Strengthen PLCAA Against Destructive Lawfare

Reading Time: 2:7 min

Over 20 years ago, a bipartisan Congress passed the Protection of Lawful Commerce in Arms Act (PLCAA) to shield the weapons industry from frivolous lawsuits intended to destroy manufacturers and…

View post

Oregon Lawmaker Blasts Initiative That Would Effectively Ban Hunting

Reading Time: 2:15 min

The Second Amendment community is a big tent, and any law-abiding American who supports constitutional rights is welcome.  That’s regardless of political affiliation as well, and honest observers note that…

View post
<script>
  /*Source: https://github.com/Krzysztof-Antosik/Two-direction-Sticky-Sidebar*/
  
  // Verificar el ancho de pantalla al cargar y redimensionar
  function checkScreenWidth() {
    if (window.innerWidth <= 767) {
      // Si la pantalla es menor o igual a 676px, no ejecutar el código
      return;
    }

    const stickyElement = document.querySelector('.fb-sidebar__aside');
    const startPosition = stickyElement.getBoundingClientRect().top;

    let endScroll = window.innerHeight - stickyElement.offsetHeight - 500;
    let currPos = window.scrollY;
    let screenHeight = window.innerHeight;
    let stickyElementHeight = stickyElement.offsetHeight;
    let topGap = 40;
    let bottomGap = 40;

    setTimeout(() => {
      if (stickyElement.hasAttribute('data-top-gap')) {
        const dataTopGap = stickyElement.getAttribute('data-top-gap');
        topGap = dataTopGap === 'auto' ? startPosition : parseInt(dataTopGap);
      }

      if (stickyElement.hasAttribute('data-bottom-gap')) {
        bottomGap = parseInt(stickyElement.getAttribute('data-bottom-gap'));
      }
    }, 100);

    stickyElement.style.position = 'sticky';
    stickyElement.style.top = `${topGap}px`;
    stickyElement.style.height = 'fit-content';

    function positionStickySidebar() {
      endScroll = window.innerHeight - stickyElement.offsetHeight - bottomGap;
      const stickyElementTop = parseInt(stickyElement.style.top.replace('px', ''));

      if (stickyElementHeight + topGap + bottomGap > screenHeight) {
        if (window.scrollY < currPos) {
          if (stickyElementTop < topGap) {
            stickyElement.style.top = `${stickyElementTop + currPos - window.scrollY}px`;
          } else if (stickyElementTop >= topGap && stickyElementTop !== topGap) {
            stickyElement.style.top = `${topGap}px`;
          }
        } else {
          if (stickyElementTop > endScroll) {
            stickyElement.style.top = `${stickyElementTop + currPos - window.scrollY}px`;
          } else if (stickyElementTop < endScroll && stickyElementTop !== endScroll) {
            stickyElement.style.top = `${endScroll}px`;
          }
        }
      } else {
        stickyElement.style.top = `${topGap}px`;
      }
      currPos = window.scrollY;
    }

    function stickyElementToMe() {
      stickyElement.style.top = `${topGap}px`;
    }

    function updateSticky() {
      screenHeight = window.innerHeight;
      stickyElementHeight = stickyElement.offsetHeight;
      positionStickySidebar();
    }

    setTimeout(() => {
      window.addEventListener('resize', () => {
        currPos = window.scrollY;
        updateSticky();
      });

      document.addEventListener('scroll', updateSticky, {
        capture: true,
        passive: true
      });
    }, 1000);
  }

  // Verificar el ancho de pantalla al cargar y redimensionar
  window.addEventListener('load', checkScreenWidth);
  window.addEventListener('resize', checkScreenWidth);
</script>