File tree Expand file tree Collapse file tree 3 files changed +26
-23
lines changed
uikit-workshop/src/scripts/components Expand file tree Collapse file tree 3 files changed +26
-23
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,15 @@ window.PluginTab = {
6
6
init : function ( ) {
7
7
//placeholder that will be replaced during configuation
8
8
//most plugins could probably just implement logic here instead.
9
- /*SNIPPETS*/
9
+ function addPanels ( ) {
10
+ /*SNIPPETS*/
11
+ }
12
+
13
+ // workaround to try recovering from load order race conditions
14
+ if ( window . patternlab && window . patternlab . panels ) {
15
+ addPanels ( ) ;
16
+ } else {
17
+ document . addEventListener ( 'patternLab.pageLoad' , addPanels ) ;
18
+ }
10
19
} ,
11
20
} ;
Original file line number Diff line number Diff line change 1
- function addPanels ( ) {
2
- window . patternlab . panels . add ( {
3
- id : 'sg-panel-scss' ,
4
- name : 'SCSS' ,
5
- default : false ,
6
- templateID : 'pl-panel-template-code' ,
7
- httpRequest : true ,
8
- httpRequestReplace : '.scss' ,
9
- httpRequestCompleted : false ,
10
- prismHighlight : true ,
11
- language : 'scss' ,
12
- keyCombo : 'ctrl+shift+z' ,
13
- } ) ;
14
- }
15
-
16
- // workaround to try recovering from load order race conditions
17
- if ( window . patternlab && window . patternlab . panels ) {
18
- addPanels ( ) ;
19
- } else {
20
- document . addEventListener ( 'patternLab.pageLoad' , addPanels ) ;
21
- }
1
+ window . patternlab . panels . add ( {
2
+ id : 'sg-panel-<<type>>' ,
3
+ name : '<<typeUC>>' ,
4
+ default : window . config . defaultPatternInfoPanelCode && window . config . defaultPatternInfoPanelCode === "<<type>>" ,
5
+ templateID : 'pl-panel-template-code' ,
6
+ httpRequest : true ,
7
+ httpRequestReplace : '.<<type>>' ,
8
+ httpRequestCompleted : false ,
9
+ prismHighlight : true ,
10
+ language : '<<type>>' //,
11
+ /* TODO: We would need to find a way to enable keyCombo for multiple panels
12
+ keyCombo: 'ctrl+shift+z',*/
13
+ } ) ;
Original file line number Diff line number Diff line change @@ -68,7 +68,9 @@ function init(event) {
68
68
Panels . add ( {
69
69
id : 'pl-panel-pattern' ,
70
70
name : window . config . patternExtension . toUpperCase ( ) ,
71
- default : true ,
71
+ default : ! window . config . defaultPatternInfoPanelCode ||
72
+ window . config . defaultPatternInfoPanelCode ===
73
+ window . config . patternExtension ,
72
74
templateID : 'pl-panel-template-code' ,
73
75
httpRequest : true ,
74
76
httpRequestReplace : fileSuffixPattern ,
You can’t perform that action at this time.
0 commit comments