Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow full-screen snapshots #1301

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion addon/components/paper-backdrop.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{! template-lint-disable no-invalid-interactive }}
<md-backdrop
{{lock-body}}
{{on "click" (fn this.sendClickAction @onClick)}}
{{on "touchEnd" (fn this.sendClickAction @onClick)}}
{{css-transition
Expand All @@ -13,4 +14,12 @@
style={{if @fixed 'position:fixed;'}}
...attributes>
{{yield}}
</md-backdrop>
</md-backdrop>

{{!-- TODO once we move to a v2 addon we should be able to import a style properly here. I added this to prevent us needing to mess with complicated style build systems --}}
{{!-- template-lint-disable no-forbidden-elements --}}
<style>
.ember-paper-lockbody {
overflow: hidden;
}
</style>
5 changes: 1 addition & 4 deletions addon/components/paper-sidenav-container.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
/* eslint-disable ember/no-classic-components, ember/require-tagless-components, prettier/prettier */
/* eslint-disable ember/no-classic-components, ember/require-tagless-components */
/**
* @module ember-paper
*/
import Component from '@ember/component';

import { htmlSafe } from '@ember/template';

/**
* @class PaperSidenavContainer
* @extends Ember.Component
*/
export default Component.extend({
classNames: ['flex', 'layout-row'],
attributeBindings: ['style'],
style: htmlSafe('overflow: hidden')
});
16 changes: 16 additions & 0 deletions addon/modifiers/lock-body.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { modifier } from 'ember-modifier';

const LOCK_BODY_CLASS = 'ember-paper-lockbody';

export default modifier(
function lockBody(/*element /*, positional, named*/) {
document.querySelector('body').classList.add(LOCK_BODY_CLASS);

return () => {
document.querySelector('body').classList.remove(LOCK_BODY_CLASS);
};
},
{
eager: false,
}
);
1 change: 1 addition & 0 deletions app/modifiers/lock-body.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-paper/modifiers/lock-body';
26 changes: 3 additions & 23 deletions tests/dummy/app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,9 @@ $accent: 'pink';
* Needed styles to set correct widths.
*/

body {
max-width: 100%;
max-height: 100%;
}

body.ember-application {
flex-direction: row;
flex: 1;
display: flex;
}

body > div.ember-view {
flex-direction: row;
flex: 1;
display: flex;
}

.site-nav-container {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
md-sidenav.md-locked-open {
position: sticky !important;
height: 100vh;
}

md-toolbar.md-warn {
Expand Down
Loading