mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-13 19:12:49 +00:00
Added files
This commit is contained in:
17
mongoui/mongoui-master/node_modules/derby-ui-boot/tabs/index.html
generated
vendored
Normal file
17
mongoui/mongoui-master/node_modules/derby-ui-boot/tabs/index.html
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<tabs: nonvoid>
|
||||
<ul class="nav nav-tabs">
|
||||
{#each :self.tabs}
|
||||
<li class="{#if equal(.name, :self.current)}active{/}">
|
||||
<a x-bind="click: _clickTab" data-target="{.name}">{.title}</a>
|
||||
</li>
|
||||
{/}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
{{@content}}
|
||||
</div>
|
||||
|
||||
<tab: nonvoid>
|
||||
<div class="tab-pane {#if :self.active}active{/} tab_{.name}">
|
||||
{{@content}}
|
||||
</div>
|
||||
37
mongoui/mongoui-master/node_modules/derby-ui-boot/tabs/index.js
generated
vendored
Normal file
37
mongoui/mongoui-master/node_modules/derby-ui-boot/tabs/index.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
exports.init = function(model) {
|
||||
var tabs = this.tabs = model.at('tabs')
|
||||
, current = this.current = model.at('current')
|
||||
|
||||
this.on('init:child', function(child, type) {
|
||||
if (type !== 'lib:tab') return
|
||||
var childModel = child.model
|
||||
, name = childModel.get('name') || tabs.get('length') || 0
|
||||
, title = childModel.get('title')
|
||||
tabs.push({name: name, title: title, model: childModel})
|
||||
this.select()
|
||||
})
|
||||
|
||||
current.on('set', function(name) {
|
||||
var items = tabs.get()
|
||||
, i = items && items.length
|
||||
, tab
|
||||
while (i--) {
|
||||
tab = items[i]
|
||||
tab.model.set('active', tab.name == name)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
exports.select = function(name) {
|
||||
if (name == null) name = this.current.get()
|
||||
if (name == null) name = this.tabs.get('0.name')
|
||||
this.current.set(name)
|
||||
}
|
||||
|
||||
exports._clickTab = function(e, el) {
|
||||
$('.nav-tabs').find('li.active').removeClass('active');
|
||||
$('.tab-content').find('.active').removeClass('active');
|
||||
$(el).parent().addClass('active');
|
||||
$('.tab-content').find('.tab_' + $(el).attr('data-target')).addClass('active');
|
||||
this.select(this.model.at(el).get('name'));
|
||||
}
|
||||
Reference in New Issue
Block a user