Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[jan] Remember currently open tab when switching between contact view…
…ing and editing (Request #12609).
- Loading branch information
Showing
4 changed files
with
41 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,37 @@ | ||
var contactTabs = null; | ||
function ShowTab(tab) | ||
{ | ||
if (contactTabs == null) { | ||
contactTabs = $('page').select('.horde-buttonbar')[0].down(); | ||
} | ||
var TurbaTabs = { | ||
// Properties: current, tabs | ||
|
||
showTab: function(tab) | ||
{ | ||
var next, id; | ||
|
||
this.tabs.each(function(item) { | ||
id = item.id.substring(3); | ||
if (id == tab) { | ||
item.addClassName('horde-active'); | ||
$(id).show(); | ||
next = id; | ||
} else { | ||
item.removeClassName('horde-active'); | ||
if ($(id).visible() && | ||
!Object.isUndefined(window['sections_Turba_View_' + id])) { | ||
this.current = window['sections_Turba_View_' + id]._get(); | ||
} | ||
$(id).hide(); | ||
} | ||
}, this); | ||
|
||
contactTabs.select('li').each(function(item) { | ||
if (item.id == 'tab' + tab) { | ||
item.addClassName('horde-active'); | ||
$(item.id.substring(3)).show(); | ||
} else { | ||
item.removeClassName('horde-active'); | ||
$(item.id.substring(3)).hide(); | ||
if (this.current && | ||
!Object.isUndefined(window['sections_Turba_View_' + next])) { | ||
window['sections_Turba_View_' + next].toggle(this.current); | ||
} | ||
}); | ||
|
||
return false; | ||
} | ||
return false; | ||
}, | ||
|
||
onDomLoad: function() { | ||
this.tabs = $('page').select('.horde-buttonbar')[0].down().select('li'); | ||
} | ||
}; | ||
|
||
document.observe('dom:loaded', TurbaTabs.onDomLoad.bind(TurbaTabs)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters