Skip to content

Commit ceff63e

Browse files
committed
refactor: temporarily disable WIP code refactor for updating logic in how the viewport panel gets resized -- saving for a separate PR to limit scope of changes
1 parent 9daa9a5 commit ceff63e

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

packages/uikit-workshop/src/scripts/components/modal-viewer.js

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ export const modalViewer = {
126126
//Remove active class to modal
127127
$('.pl-js-modal').removeClass('pl-is-active');
128128

129-
$('html').css('--pl-viewport-height', window.innerHeight - 32 + 'px');
129+
// WIP: refactoring viewport panel to use CSS vars to resize
130+
// $('html').css('--pl-viewport-height', window.innerHeight - 32 + 'px');
131+
130132
// update the wording
131133
$('.pl-js-pattern-info-toggle').html('Show Pattern Info');
132134

@@ -144,10 +146,12 @@ export const modalViewer = {
144146
*/
145147
hide: function() {
146148
$('.pl-js-modal').removeClass('pl-is-active');
147-
$('html').css(
148-
'--pl-viewport-height',
149-
window.innerHeight - 32 + 'px'
150-
); /* 4 */
149+
150+
// WIP: refactoring viewport panel to use CSS vars to resize
151+
// $('html').css(
152+
// '--pl-viewport-height',
153+
// window.innerHeight - 32 + 'px'
154+
// );
151155
},
152156

153157
/**
@@ -207,14 +211,16 @@ export const modalViewer = {
207211
*/
208212
slide: function(pos) {
209213
$('.pl-js-modal').toggleClass('pl-is-active');
210-
if ($('.pl-js-modal').hasClass('pl-is-active')) {
211-
$('html').css(
212-
'--pl-viewport-height',
213-
window.innerHeight - $('.pl-js-modal').innerHeight() - 32 + 'px'
214-
);
215-
} else {
216-
$('html').css('--pl-viewport-height', window.innerHeight - 32 + 'px');
217-
}
214+
215+
// WIP: refactoring viewport panel to use CSS vars to resize
216+
// if ($('.pl-js-modal').hasClass('pl-is-active')) {
217+
// $('html').css(
218+
// '--pl-viewport-height',
219+
// window.innerHeight - $('.pl-js-modal').innerHeight() - 32 + 'px'
220+
// );
221+
// } else {
222+
// $('html').css('--pl-viewport-height', window.innerHeight - 32 + 'px');
223+
// }
218224
},
219225

220226
/**
@@ -247,10 +253,12 @@ export const modalViewer = {
247253
*/
248254
show: function() {
249255
$('.pl-js-modal').addClass('pl-is-active');
250-
$('html').css(
251-
'--pl-viewport-height',
252-
window.innerHeight - $('.pl-js-modal').innerHeight() - 32 + 'px'
253-
);
256+
257+
// WIP: refactoring viewport panel to use CSS vars to resize
258+
// $('html').css(
259+
// '--pl-viewport-height',
260+
// window.innerHeight - $('.pl-js-modal').innerHeight() - 32 + 'px'
261+
// );
254262
},
255263

256264
/**

0 commit comments

Comments
 (0)