Always clear details pane when unsetting more mode

We don't want a detail pane hanging around for an item no
longer visible.
This commit is contained in:
Colin Walters 2009-07-11 12:33:57 -04:00
parent 2161e90cda
commit 9d594d7f26

View File

@ -325,7 +325,7 @@ Dash.prototype = {
if (me._searchEntry.entry.text != '') if (me._searchEntry.entry.text != '')
me._searchEntry.entry.text = ''; me._searchEntry.entry.text = '';
// Next, if we're in one of the "more" modes or showing the details pane, close them // Next, if we're in one of the "more" modes or showing the details pane, close them
else if (me._moreAppsMode || me._moreDocsMode || me._detailsShowing()) else if (me._resultsShowing())
me.unsetMoreMode(); me.unsetMoreMode();
// Finally, just close the overlay entirely // Finally, just close the overlay entirely
else else
@ -600,10 +600,7 @@ Dash.prototype = {
this._moreAppsLink.setText("More..."); this._moreAppsLink.setText("More...");
this._repositionDetails(); this._hideDetails();
if (!this._detailsShowing()) {
this.emit('panes-removed');
}
}, },
// Sets the 'More' mode for browsing documents. // Sets the 'More' mode for browsing documents.
@ -639,11 +636,7 @@ Dash.prototype = {
this._moreDocsLink.setText("More..."); this._moreDocsLink.setText("More...");
this._repositionDetails(); this._hideDetails();
if (!this._detailsShowing()) {
this.emit('panes-removed');
}
}, },
_setSearchMode: function() { _setSearchMode: function() {
@ -682,11 +675,7 @@ Dash.prototype = {
this._resultsDocsSection._unsetSearchMode(); this._resultsDocsSection._unsetSearchMode();
this._resultsDocsSection.actor.set_y(0); this._resultsDocsSection.actor.set_y(0);
this._repositionDetails(); this._hideDetails();
if (!this._detailsShowing()) {
this.emit('panes-removed');
}
}, },
_repositionDetails: function () { _repositionDetails: function () {
@ -705,6 +694,13 @@ Dash.prototype = {
this.emit('panes-displayed'); this.emit('panes-displayed');
}, },
_hideDetails: function() {
if (!this._detailsShowing)
return;
this._detailsPane.hide();
this.emit('panes-removed');
},
_detailsShowing: function() { _detailsShowing: function() {
return this._detailsPane.visible; return this._detailsPane.visible;
}, },