Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
06c7ad7
Add docs for `afterLoad`
DAreRodz Aug 10, 2023
50f2ba9
Move store options to the end
DAreRodz Aug 10, 2023
9ddc96a
Initial aspect-ration support implementation
SantosGuillamot Jul 12, 2023
30bed25
Move `inherit` property to `wp-style` directive
SantosGuillamot Jul 19, 2023
fb66e7a
Add `object-fit` cover
SantosGuillamot Jul 19, 2023
006ad65
Fix big images aspect ratio
SantosGuillamot Jul 19, 2023
153cd20
Fix animation on mobile; add comments
artemiomorales Jul 19, 2023
f3b66d5
Remove obsolete variable declaration
artemiomorales Jul 19, 2023
4901179
Fix PHP spacing
artemiomorales Jul 19, 2023
62305ee
Optimize animation performance; add comments; fix fade and thumbnail …
artemiomorales Jul 21, 2023
679d13e
Handle images in content with aspect ratios that differ from source i…
artemiomorales Jul 25, 2023
b751766
Simplify zooming lightbox
SantosGuillamot Jul 26, 2023
0c001ef
Add support for thumbnails
SantosGuillamot Jul 27, 2023
2933cfd
Clean code and change variable names
SantosGuillamot Jul 27, 2023
c514820
Fix thumbnails with cropped width and height
SantosGuillamot Jul 28, 2023
d267107
Add support for contain setting
SantosGuillamot Jul 28, 2023
e6ffc39
Add 5% padding to the lightbox container
SantosGuillamot Jul 28, 2023
8476b81
Move CSS properties to style tag
SantosGuillamot Jul 28, 2023
be53060
Add wp prefix to CSS global variables
SantosGuillamot Jul 28, 2023
e15b8d4
Remove `!important` from CSS
SantosGuillamot Jul 28, 2023
74ebaf9
Reuse zooming logic for the fade animation
SantosGuillamot Jul 28, 2023
08e0753
Remove fade conditional
SantosGuillamot Jul 28, 2023
f213d3b
Fix php standards
cbravobernal Jul 28, 2023
23081b6
Remove unnecessary inheritSize selector
SantosGuillamot Jul 28, 2023
71d703e
Update e2e test to fit new style tag
cbravobernal Jul 28, 2023
4a61010
Fix width of image container so button isn't wider than image
artemiomorales Jul 28, 2023
412ef4b
Add variable horizontal padding and fixed vertical padding
artemiomorales Jul 28, 2023
8d71c44
Fix fade out animation; modify animation for image slightly
artemiomorales Jul 28, 2023
e16120f
Prevent scroll after focusing last image
SantosGuillamot Jul 31, 2023
33d5f86
Add support for contain in lightbox image button
SantosGuillamot Jul 31, 2023
c947661
Add logic to set button styles only when needed and on image load
artemiomorales Aug 1, 2023
2c5f900
Simplify lazy loading logic
artemiomorales Aug 1, 2023
3b144d5
Remove extra div from image markup
artemiomorales Aug 2, 2023
ecbacda
Add 1 pixel to container dimensions to fix style bug on iOS
artemiomorales Aug 2, 2023
eb9a7dc
Add logic to center button when using 'contain'
artemiomorales Aug 2, 2023
8ba67ec
(After merge) Add logic to set button styles on window resize
artemiomorales Aug 9, 2023
31c9e4b
Replace loading=lazy with manual setting of src attribute
artemiomorales Aug 10, 2023
8083c39
Add link to comment
artemiomorales Aug 10, 2023
c09b11a
Remove obsolete code
artemiomorales Aug 10, 2023
0a04a6c
Update tests
artemiomorales Aug 11, 2023
efe4582
Add clarifying comment to setting of responsive image src attribute
artemiomorales Aug 11, 2023
6dc3da2
Update clarifying comment on 1px bug in iOS
artemiomorales Aug 11, 2023
b9c84e4
Add namespace to state
artemiomorales Aug 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove obsolete code
  • Loading branch information
artemiomorales committed Aug 11, 2023
commit c09b11a0e426b55cd1dfe2e0040074f2d69a0f03
23 changes: 0 additions & 23 deletions packages/block-library/src/image/view-interactivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,6 @@ store(
document.documentElement.classList.add(
'wp-has-lightbox-open'
);

// Since the img is hidden and its src not loaded until
// the lightbox is opened, let's create an img element on the fly
// so we can get the dimensions we need to calculate the styles
context.core.image.preloadInitialized = true;
const imgDom = document.createElement( 'img' );
imgDom.onload = function () {
context.core.image.activateLargeImage = true;
};
imgDom.setAttribute(
'src',
context.core.image.imageUploadedSrc
);
},
hideLightbox: async ( { context, event } ) => {
context.core.image.hideAnimationEnabled = true;
Expand Down Expand Up @@ -148,16 +135,6 @@ store(
ref,
} );
},
preloadLightboxImage: ( { context } ) => {
if ( ! context.core.image.preloadInitialized ) {
context.core.image.preloadInitialized = true;
const imgDom = document.createElement( 'img' );
imgDom.setAttribute(
'src',
context.core.image.imageUploadedSrc
);
}
},
},
},
},
Expand Down