Index: trunk/extensions/CategoryTree/modules/ext.categoryTree.js |
— | — | @@ -110,7 +110,8 @@ |
111 | 111 | // Element may not have a .CategoryTreeTag parent, fallback to defauls |
112 | 112 | // Probably a CategoryPage (@todo: based on what?) |
113 | 113 | ctTitle = $link.data( 'ct-title' ); |
114 | | - ctMode = $linkParentCTTag.data( 'ct-mode' ) || undefined; |
| 114 | + ctMode = $linkParentCTTag.data( 'ct-mode' ); |
| 115 | + ctMode = typeof ctMode === 'number' ? ctMode : undefined; |
115 | 116 | ctOptions = $linkParentCTTag.data( 'ct-options' ) || mw.config.get( 'wgCategoryTreePageCategoryOptions' ); |
116 | 117 | |
117 | 118 | // Mode and options have defaults or fallbacks, title does not. |
— | — | @@ -133,15 +134,19 @@ |
134 | 135 | |
135 | 136 | if ( data === '' ) { |
136 | 137 | switch ( ctMode ) { |
| 138 | + // CT_MODE_CATEGORIES = 0 |
137 | 139 | case 0: |
138 | 140 | data = mw.msg( 'categorytree-no-subcategories' ); |
139 | 141 | break; |
| 142 | + // CT_MODE_PAGES = 10 |
140 | 143 | case 10: |
141 | 144 | data = mw.msg( 'categorytree-no-pages' ); |
142 | 145 | break; |
| 146 | + // CT_MODE_PARENTS = 100 |
143 | 147 | case 100: |
144 | 148 | data = mw.msg( 'categorytree-no-parent-categories' ); |
145 | 149 | break; |
| 150 | + // CT_MODE_ALL = 20 |
146 | 151 | default: |
147 | 152 | data = mw.msg( 'categorytree-nothing-found' ); |
148 | 153 | } |
— | — | @@ -153,6 +158,7 @@ |
154 | 159 | .html( data ) |
155 | 160 | .find( '.CategoryTreeToggle' ) |
156 | 161 | .click( categoryTree.handleNode ); |
| 162 | + |
157 | 163 | categoryTree.showToggles(); |
158 | 164 | } ) |
159 | 165 | .error( error ); |