Skip to content

Commit

Permalink
Fix settings pullup for model3D files on mobile (#222)
Browse files Browse the repository at this point in the history
* Fix: Settings pullup fits on mobile

* Fix: Fix inputs in the Model3DPullup

* Chore: Responding to comments
  • Loading branch information
Jeremy Press committed Jul 17, 2017
1 parent c309da1 commit f285ba8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/lib/Controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ class Controls {
* @param {Event} event - A DOM-normalized event object.
* @return {void}
*/
clickHandler = (event) => {
event.preventDefault();
clickHandler = () => {
// If we are not focused in on the page num input, allow hiding after timeout
this.shouldHide = true;
};
Expand Down
9 changes: 0 additions & 9 deletions src/lib/__tests__/Controls-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,6 @@ describe('lib/Controls', () => {
});

describe('clickHandler()', () => {
const event = {
preventDefault: sandbox.stub()
};

it('should prevent default', () => {
controls.clickHandler(event);
expect(event.preventDefault).to.be.called;
});

it('should stop block hiding', () => {
controls.clickHandler(event);
expect(controls.shouldHide).to.be.true;
Expand Down
1 change: 1 addition & 0 deletions src/lib/viewers/box3d/Box3DControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import autobind from 'autobind-decorator';
import Controls from '../../Controls';
import { EVENT_RESET, EVENT_SCENE_LOADED, EVENT_TOGGLE_FULLSCREEN, EVENT_TOGGLE_VR } from './box3DConstants';
import { ICON_FULLSCREEN_IN, ICON_FULLSCREEN_OUT, ICON_3D_VR } from '../../icons/icons';
import './Box3DControls.scss';

import { CLASS_HIDDEN } from '../../constants';
import { UIRegistry } from './Box3DUIUtils';
Expand Down
15 changes: 15 additions & 0 deletions src/lib/viewers/box3d/Box3DControls.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$compact-width: 375px;
$compact-height: 550px;

@media (max-width: $compact-width) {
.bp-box3d .bp-pullup {
right: 0;
}
}

@media (max-height: $compact-height) {
.bp-box3d .bp-pullup {
height: 250px;
overflow: scroll;
}
}
2 changes: 1 addition & 1 deletion src/lib/viewers/box3d/model3d/Model3D.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $arrow-top-bottom: 4px solid transparent;
}

.bp-pullup {
bottom: calc(100%);
bottom: 100%;
padding: 0 10px 20px;
text-align: left;
}
Expand Down

0 comments on commit f285ba8

Please sign in to comment.