File tree Expand file tree Collapse file tree
packages/uikit-workshop/src/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55import $ from 'jquery' ;
66import Mousetrap from 'mousetrap' ;
7- import { urlHandler , DataSaver } from '../utils' ;
7+ import { urlHandler , DataSaver , patternName } from '../utils' ;
88
99( function ( w ) {
1010 let sw = document . body . clientWidth ; //Viewport Width
@@ -523,17 +523,8 @@ import { urlHandler, DataSaver } from '../utils';
523523 '//' +
524524 window . location . host +
525525 window . location . pathname . replace ( 'index.html' , '' ) ;
526- let patternName =
527- window . config . defaultPattern !== undefined &&
528- typeof window . config . defaultPattern === 'string' &&
529- window . config . defaultPattern . trim ( ) . length > 0
530- ? window . config . defaultPattern
531- : 'all' ;
532526 let iFramePath =
533527 baseIframePath + 'styleguide/html/styleguide.html?' + Date . now ( ) ;
534- if ( oGetVars . p !== undefined || oGetVars . pattern !== undefined ) {
535- patternName = oGetVars . p !== undefined ? oGetVars . p : oGetVars . pattern ;
536- }
537528
538529 if ( patternName !== 'all' ) {
539530 const patternPath = urlHandler . getFileName ( patternName ) ;
Original file line number Diff line number Diff line change @@ -7,3 +7,4 @@ export { css } from './css';
77export { extend } from './extend' ;
88export { supportsShadowDom } from './supports-shadow-dom' ;
99export { targetOrigin } from './get-target-origin' ;
10+ export { patternName } from './pattern-name' ;
Original file line number Diff line number Diff line change 1+ import { urlHandler } from '../utils' ;
2+
3+ let patternName = '' ;
4+
5+ if ( window . config ) {
6+ patternName =
7+ window . config . defaultPattern !== undefined &&
8+ typeof window . config . defaultPattern === 'string' &&
9+ window . config . defaultPattern . trim ( ) . length > 0
10+ ? window . config . defaultPattern
11+ : 'all' ;
12+
13+ // get the request vars
14+ const oGetVars = urlHandler . getRequestVars ( ) ;
15+
16+ if ( oGetVars . p !== undefined || oGetVars . pattern !== undefined ) {
17+ patternName = oGetVars . p !== undefined ? oGetVars . p : oGetVars . pattern ;
18+ }
19+ }
20+
21+ export { patternName } ;
You can’t perform that action at this time.
0 commit comments