-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1167 from JosefBredereck/feature-resize-viewport-…
…and-shortcuts Support for manual viewport size input & reintroduce resize key combinations
- Loading branch information
Showing
17 changed files
with
551 additions
and
194 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
24 changes: 24 additions & 0 deletions
24
...p/src/scripts/lit-components/pl-viewport-size-list/pl-viewport-size-list.iframe-helper.js
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,24 @@ | ||
import { targetOrigin } from '../../utils'; | ||
|
||
function sendPatternLabKeyEvent(e, name) { | ||
try { | ||
window.parent.postMessage( | ||
JSON.stringify({ | ||
event: `patternLab.${name}`, | ||
key: e.key, | ||
code: e.code, | ||
}), | ||
targetOrigin | ||
); | ||
} catch (error) { | ||
// @todo: how do we want to handle exceptions here? | ||
} | ||
} | ||
|
||
document.addEventListener('keydown', e => { | ||
sendPatternLabKeyEvent(e, 'iframeKeyDownEvent'); | ||
}); | ||
|
||
document.addEventListener('keyup', e => { | ||
sendPatternLabKeyEvent(e, 'iframeKeyUpEvent'); | ||
}); |
Oops, something went wrong.