mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-26 18:31:29 +00:00
+ Groups now track their last-focused tab. When you click on the group, it brings you back to the group with the appropriate tab focused.
This commit is contained in:
parent
525ab6e9ab
commit
3c66e85d7a
@ -65,6 +65,7 @@ window.Group = function(listOfEls, options) {
|
||||
this.expanded = null;
|
||||
this.locked = (options.locked ? Utils.copy(options.locked) : {});
|
||||
this.topChild = null;
|
||||
this._activeTab = null;
|
||||
|
||||
if(isPoint(options.userSize))
|
||||
this.userSize = new Point(options.userSize);
|
||||
@ -265,6 +266,20 @@ window.Group = function(listOfEls, options) {
|
||||
window.Group.prototype = $.extend(new Item(), new Subscribable(), {
|
||||
// ----------
|
||||
defaultName: "name this group...",
|
||||
|
||||
// -----------
|
||||
// TODO: This currently accepts only the DOM element of a tab.
|
||||
// It should also take a TabItem...
|
||||
setActiveTab: function(tab){
|
||||
this._activeTab = tab;
|
||||
},
|
||||
|
||||
// -----------
|
||||
// TODO: This currently returns a DOM element of the selected tab.
|
||||
// It should probably actually be a TabItem...
|
||||
getActiveTab: function(tab){
|
||||
return this._activeTab;
|
||||
},
|
||||
|
||||
// ----------
|
||||
getStorageData: function() {
|
||||
@ -971,6 +986,13 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
|
||||
});
|
||||
}
|
||||
|
||||
$(container).click(function(){
|
||||
var activeTab = self.getActiveTab();
|
||||
if( activeTab ) TabItems.zoomTo(activeTab)
|
||||
// TODO: This should also accept TabItems
|
||||
else TabItems.zoomTo(self.getChild(0).tab.mirror.el);
|
||||
});
|
||||
|
||||
$(container).droppable({
|
||||
tolerance: "intersect",
|
||||
over: function(){
|
||||
|
@ -419,7 +419,8 @@ window.TabItems = {
|
||||
if( self.getItemByTab(tabEl).parent ){
|
||||
var gID = self.getItemByTab(tabEl).parent.id;
|
||||
var group = Groups.group(gID);
|
||||
Groups.setActiveGroup( group );
|
||||
Groups.setActiveGroup( group );
|
||||
group.setActiveTab( tabEl );
|
||||
}
|
||||
else
|
||||
Groups.setActiveGroup( null );
|
||||
|
Loading…
Reference in New Issue
Block a user