Skip to content

Commit

Permalink
feat: new options for ForceResponsiveViewportFeature
Browse files Browse the repository at this point in the history
- minScale
- initScale
  • Loading branch information
jsamr committed Dec 4, 2020
1 parent 010ae1e commit 6141e8a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
16 changes: 15 additions & 1 deletion packages/webshell/src/features/ForceResponsiveViewportFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,24 @@ export interface ForceResponsiveViewportOptions {
* @defaultvalue 1
*/
maxScale?: number;
/**
* Minimum pinch-zoom scale.
*
* @defaultvalue 1
*/
minScale?: number;
/**
* Initial zoom scale.
*
* @defaultvalue 1
*/
initScale?: number;
}

const defaultOptions: Required<ForceResponsiveViewportOptions> = {
maxScale: 1
maxScale: 1,
initScale: 1,
minScale: 1
};

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
function ForceResponsiveViewportFeature(context) {
var options = context.options || {};
var maxScale = options.maxScale || 1;
var initScale = options.initScale || 1;
var minScale = options.minScale || 1;
var metaViewportContent =
'width=device-width, ' +
'initial-scale=1, ' +
'minimum-scale=1, ' +
'initial-scale=' +
initScale +
',' +
'minimum-scale=' +
minScale +
',' +
'maximum-scale=' +
maxScale;
var metaElements = document.getElementsByTagName('meta');
Expand Down

0 comments on commit 6141e8a

Please sign in to comment.