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

Fix settings pullup for model3D files on mobile #222

Merged
merged 4 commits into from
Jul 17, 2017
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
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