Minor clean up, tabs can now define a url (data-tab-url) set using replaceState

This commit is contained in:
Samuel Georges 2015-04-04 17:26:47 +11:00
parent 37dea95caa
commit 9e9aa97101
4 changed files with 14 additions and 6 deletions

View File

@ -87,7 +87,8 @@ $el.on('oc.triggerOn.update',function(e){e.stopPropagation()
self.onConditionChanged()})
self.onConditionChanged()}
TriggerOn.prototype.onConditionChanged=function(){if(this.triggerCondition=='checked'){this.updateTarget($(this.options.trigger+':checked',this.triggerParent).length>0)}
else if(this.triggerCondition=='value'){var trigger=$(this.options.trigger+':checked',this.triggerParent);if(trigger.length){this.updateTarget(trigger.val()==this.triggerConditionValue)}else{this.updateTarget($(this.options.trigger,this.triggerParent).val()==this.triggerConditionValue)}}}
else if(this.triggerCondition=='value'){var trigger=$(this.options.trigger+':checked',this.triggerParent);if(trigger.length){this.updateTarget(trigger.val()==this.triggerConditionValue)}
else{this.updateTarget($(this.options.trigger,this.triggerParent).val()==this.triggerConditionValue)}}}
TriggerOn.prototype.updateTarget=function(status){if(this.options.triggerAction=='show')
this.$el.toggleClass('hide',!status).trigger('hide.oc.triggerapi',[!status])
else if(this.options.triggerAction=='hide')
@ -394,7 +395,9 @@ this.$el.on('modified.oc.tab',function(ev){ev.preventDefault()
self.modifyTab($(ev.target).closest('ul.nav-tabs > li, div.tab-content > div'))})
this.$el.on('unmodified.oc.tab',function(ev){ev.preventDefault()
self.unmodifyTab($(ev.target).closest('ul.nav-tabs > li, div.tab-content > div'))})
this.$tabsContainer.on('shown.bs.tab','li',function(){$(window).trigger('oc.updateUi')})
this.$tabsContainer.on('shown.bs.tab','li',function(){$(window).trigger('oc.updateUi')
var tabUrl=$('> a',this).data('tabUrl')
if(tabUrl){window.history.replaceState({},'Tab link reference',tabUrl)}})
if(this.options.slidable){this.$pagesContainer.touchwipe({wipeRight:function(){self.prev();},wipeLeft:function(){self.next();},preventDefaultEvents:false,min_move_x:60});}
this.$tabsContainer.toolbar({scrollClassContainer:this.$el})
this.updateClasses()}

View File

@ -107,8 +107,13 @@
})
this.$tabsContainer.on('shown.bs.tab', 'li', function(){
// self.$tabsContainer.dragScroll('fixScrollClasses')
$(window).trigger('oc.updateUi')
// self.$tabsContainer.dragScroll('fixScrollClasses')
$(window).trigger('oc.updateUi')
var tabUrl = $('> a', this).data('tabUrl')
if (tabUrl) {
window.history.replaceState({}, 'Tab link reference', tabUrl)
}
})
if (this.options.slidable) {

View File

@ -1,4 +1,4 @@
<div class="padded-container list-header">
<div class="padded-container container-flush">
<?= $this->makeHintPartial('system_eventlogs_hint', 'hint') ?>
</div>

View File

@ -1,4 +1,4 @@
<div class="padded-container list-header">
<div class="padded-container container-flush">
<?= $this->makeHintPartial('system_requestlogs_hint', 'hint') ?>
</div>