Skip to content

Commit

Permalink
Merge pull request #75 from Brightspace/Responsive_flaoting_behavior
Browse files Browse the repository at this point in the history
Responsive floating behavior
  • Loading branch information
capajon authored Oct 3, 2016
2 parents 0ca8f11 + 8888cf9 commit 1baf6bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
9 changes: 3 additions & 6 deletions d2l-floating-buttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@
}
</style>

<iron-media-query query="(max-width: 555px)" query-matches="{{_widthAtMost555px}}"></iron-media-query>
<iron-media-query query="(max-height: 300px)" query-matches="{{_heightAtMost300px}}"></iron-media-query>
<iron-media-query query="(max-height: 500px)" query-matches="{{_heightAtMost500px}}"></iron-media-query>

<div class="d2l-floating-buttons-container">
<div><content></content></div>
Expand All @@ -83,8 +82,7 @@
is: 'd2l-floating-buttons',

properties: {
_heightAtMost300px: Boolean,
_widthAtMost555px: Boolean
_heightAtMost500px: Boolean
},

_container: null,
Expand Down Expand Up @@ -141,8 +139,7 @@

var innerContainer = this._container.querySelector('div');

if (this._widthAtMost555px ||
this._heightAtMost300px ||
if ( this._heightAtMost500px ||
((containerTop + containerRect.height) <= viewBottom)
) {

Expand Down
2 changes: 1 addition & 1 deletion test/index-mobile.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="../../web-component-tester/browser.js"></script>
<style>
#subsuites {
width: 300px;
height: 250px;
}
</style>
</head>
Expand Down
3 changes: 2 additions & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<script src="../../web-component-tester/browser.js"></script>
<style>
#subsuites {
width: 900px;
height: 800px;
width: 800px;
}
</style>
</head>
Expand Down

0 comments on commit 1baf6bd

Please sign in to comment.