-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved image-catalog-picker on mobile (#137)
* Improved image-catalog-picker on mobile * Update 100vh-fix.js Co-authored-by: Jeroen Vloothuis <[email protected]>
- Loading branch information
1 parent
6ee1fbd
commit 8f42519
Showing
16 changed files
with
314 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import _ from 'lodash' | ||
|
||
let resizeHandler | ||
|
||
export const ViewportResize = { | ||
|
||
mounted () { | ||
// Direct push of current window size to properly update view | ||
this.pushResizeEvent() | ||
|
||
resizeHandler = _.debounce(() => { | ||
this.pushResizeEvent() | ||
}, 100) | ||
window.addEventListener('resize', resizeHandler) | ||
}, | ||
|
||
pushResizeEvent () { | ||
console.log("pushResizeEvent") | ||
this.pushEvent('viewport_resize', { | ||
width: window.innerWidth, | ||
height: window.innerHeight | ||
}) | ||
}, | ||
|
||
turbolinksDisconnected () { | ||
window.removeEventListener('resize', resizeHandler) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.