Proyectos de Subversion Moodle

Rev

Rev 205 | Rev 221 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 205 Rev 206
Línea 124... Línea 124...
124
 
124
 
125
</body>
125
</body>
126
</html>
126
</html>
127
{{#js}}
127
{{#js}}
128
M.util.js_pending('theme_universe/loader');
128
M.util.js_pending('theme_universe/loader');
129
require(['theme_universe/loader', 'theme_universe/drawer', 'jquery'], function(Loader, Drawer, $) {
129
require(['theme_universe/loader', 'theme_universe/drawer'], function(Loader, Drawer) {
130
    Drawer.init();
130
    Drawer.init();
Línea 131... Línea 131...
131
    M.util.js_complete('theme_universe/loader');
131
    M.util.js_complete('theme_universe/loader');
132
 
132
 
Línea 154... Línea 154...
154
                }
154
                }
155
            }
155
            }
156
        }
156
        }
157
    }
157
    }
Línea 158... Línea -...
158
 
-
 
159
    function renderBlockButtons(){
-
 
160
        const buttonsContainer = $("#blocks_buttons");
-
 
161
        const blocksContainer = $(".block-region");
-
 
162
        const blocks = blocksContainer.find("section.block").toArray();
-
 
163
 
-
 
164
        $(blocksContainer).addClass("tab-content")
-
 
165
 
-
 
166
        const blocksObjs = []
-
 
167
 
-
 
168
        $(blocks).each((index, block) => {
-
 
169
            const blckId = $(block).attr("id").trim()
-
 
170
            const blckTitle = $(block).find(".card-title").text()
-
 
171
 
-
 
172
            $(block).addClass("tab-pane fade")
-
 
173
            if(index === 0) $(block).addClass("active show")
-
 
174
 
-
 
175
            const blckObj = { id: blckId, title: blckTitle }
-
 
176
 
-
 
177
            blocksObjs.push(blckObj)
-
 
178
        })
-
 
179
 
-
 
180
        blocksObjs.forEach(({ id, title }, index)=> {
-
 
181
            const blockBtn = `
-
 
182
                <button class="btn nav-link ${index === 0 ? 'active' : ''}" data-toggle="tab" data-target="#${id}" type="button" role="tab" aria-controls="nav-home" aria-selected="true">${title}</button>
-
 
183
            ` 
-
 
184
 
-
 
185
            buttonsContainer.append(blockBtn)
-
 
186
        })
-
 
187
    }
-
 
188
 
158
 
189
    resizeVideoIframe()
-
 
190
    renderBlockButtons()
159
    resizeVideoIframe()
191
});
160
});