|
7 | 7 | (function (w) {
|
8 | 8 |
|
9 | 9 | var sw = document.body.clientWidth, //Viewport Width
|
10 |
| - sh = $(document).height(), //Viewport Height |
11 |
| - minViewportWidth = parseInt(config.ishMinimum), //Minimum Size for Viewport |
12 |
| - maxViewportWidth = parseInt(config.ishMaximum), //Maxiumum Size for Viewport |
13 |
| - viewportResizeHandleWidth = 14, //Width of the viewport drag-to-resize handle |
| 10 | + sh = $(document).height(); //Viewport Height |
| 11 | + |
| 12 | + var minViewportWidth = 240; |
| 13 | + var maxViewportWidth = 2600; |
| 14 | + |
| 15 | + //set minimum and maximum viewport based on confg |
| 16 | + if (config.ishMinimum !== undefined) { |
| 17 | + minViewportWidth = parseInt(config.ishMinimum); //Minimum Size for Viewport |
| 18 | + } |
| 19 | + if (config.ishMaximum !== undefined) { |
| 20 | + maxViewportWidth = parseInt(config.ishMaximum); //Maxiumum Size for Viewport |
| 21 | + } |
| 22 | + |
| 23 | + //alternatively, use the ishViewportRange object |
| 24 | + if (config.ishViewportRange !== undefined) { |
| 25 | + minViewportWidth = config.ishViewportRange.s[0]; |
| 26 | + maxViewportWidth = config.ishViewportRange.l[1]; |
| 27 | + } |
| 28 | + |
| 29 | + var viewportResizeHandleWidth = 14, //Width of the viewport drag-to-resize handle |
14 | 30 | $sgIframe = $('.pl-js-iframe'), //Viewport element
|
15 | 31 | $sizePx = $('#pl-size-px'), //Px size input element in toolbar
|
16 | 32 | $sizeEms = $('#pl-size-em'), //Em size input element in toolbar
|
|
80 | 96 | killDisco();
|
81 | 97 | killHay();
|
82 | 98 | fullMode = false;
|
83 |
| - sizeiframe(getRandom(500, 800)); |
| 99 | + sizeiframe(getRandom( |
| 100 | + minViewportWidth, |
| 101 | + config.ishViewportRange !== undefined ? parseInt(config.ishViewportRange.s[1]) : 500 |
| 102 | + )); |
84 | 103 | }
|
85 | 104 |
|
86 | 105 | $('#pl-size-m').on("click", function (e) {
|
|
98 | 117 | killDisco();
|
99 | 118 | killHay();
|
100 | 119 | fullMode = false;
|
101 |
| - sizeiframe(getRandom(800, 1200)); |
| 120 | + sizeiframe(getRandom( |
| 121 | + config.ishViewportRange !== undefined ? parseInt(config.ishViewportRange.l[0]) : 800, |
| 122 | + config.ishViewportRange !== undefined ? parseInt(config.ishViewportRange.l[1]) : 1200 |
| 123 | + )); |
102 | 124 | }
|
103 | 125 |
|
104 | 126 | $('#pl-size-l').on("click", function (e) {
|
|
0 commit comments