File tree Expand file tree Collapse file tree 3 files changed +23
-10
lines changed
packages/uikit-workshop/src/scripts Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import $ from 'jquery' ;
6
6
import Mousetrap from 'mousetrap' ;
7
- import { urlHandler , DataSaver } from '../utils' ;
7
+ import { urlHandler , DataSaver , patternName } from '../utils' ;
8
8
9
9
( function ( w ) {
10
10
let sw = document . body . clientWidth ; //Viewport Width
@@ -523,17 +523,8 @@ import { urlHandler, DataSaver } from '../utils';
523
523
'//' +
524
524
window . location . host +
525
525
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' ;
532
526
let iFramePath =
533
527
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
- }
537
528
538
529
if ( patternName !== 'all' ) {
539
530
const patternPath = urlHandler . getFileName ( patternName ) ;
Original file line number Diff line number Diff line change @@ -7,3 +7,4 @@ export { css } from './css';
7
7
export { extend } from './extend' ;
8
8
export { supportsShadowDom } from './supports-shadow-dom' ;
9
9
export { 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