enmi12/glossaire/_includes/layout-change.js
author ymh <ymh.work@gmail.com>
Mon, 08 Sep 2025 19:44:41 +0200
changeset 23 417f20492bf7
parent 0 d970ebf37754
permissions -rwxr-xr-x
Update Docker configuration and plugin versions - Upgrade MariaDB from 10.6 to 11 with auto-upgrade support - Add WordPress debug environment variable to FPM container - Update PHP-FPM Dockerfile base image - Update Include Mastodon Feed plugin with bug fixes and improvements - Update Portfolio plugin (v2.58) with latest translations and demo data enhancements - Remove old README.md from Mastodon Feed plugin 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
      // change layout
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
      var isHorizontal = false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
      function changeLayoutMode( $link, options ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
        var wasHorizontal = isHorizontal;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
        isHorizontal = $link.hasClass('horizontal');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
        if ( wasHorizontal !== isHorizontal ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
          // orientation change
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
          // need to do some clean up for transitions and sizes
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
          var style = isHorizontal ? 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
            { height: '80%', width: $container.width() } : 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
            { width: 'auto' };
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
          // stop any animation on container height / width
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
          $container.filter(':animated').stop();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
          // disable transition, apply revised style
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
          $container.addClass('no-transition').css( style );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
          setTimeout(function(){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
            $container.removeClass('no-transition').isotope( options );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
          }, 100 )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
        } else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
          $container.isotope( options );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
        }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
      }