diff --git a/js/ui/dash.js b/js/ui/dash.js index 6d8c1a49f..88eb76c97 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -506,6 +506,13 @@ SectionHeader.prototype = { this.backLink.actor.hide(); }, + setMoreLinkVisible : function(visible) { + if (visible) + this.moreLink.actor.show(); + else + this.moreLink.actor.hide(); + }, + setCountText : function(countText) { if (countText == "") { this.countText.hide(); @@ -782,8 +789,8 @@ Dash.prototype = { this._docsSection = new Section(_("RECENT DOCUMENTS")); - let docDisplay = new DocDisplay.DashDocDisplay(); - this._docsSection.content.append(docDisplay.actor, Big.BoxPackFlags.EXPAND); + this._docDisplay = new DocDisplay.DashDocDisplay(); + this._docsSection.content.append(this._docDisplay.actor, Big.BoxPackFlags.EXPAND); this._moreDocsPane = null; this._docsSection.header.moreLink.connect('activated', Lang.bind(this, function (link) { @@ -795,6 +802,12 @@ Dash.prototype = { } })); + this._docDisplay.connect('changed', Lang.bind(this, function () { + this._docsSection.header.setMoreLinkVisible( + this._docDisplay.actor.get_children().length > 0); + })); + this._docDisplay.emit('changed'); + this.sectionArea.append(this._docsSection.actor, Big.BoxPackFlags.EXPAND); /***** Search Results *****/ diff --git a/js/ui/docDisplay.js b/js/ui/docDisplay.js index 6e7f91d8b..74e2c3d8b 100644 --- a/js/ui/docDisplay.js +++ b/js/ui/docDisplay.js @@ -302,7 +302,7 @@ DashDocDisplayItem.prototype = { shellWorkspaceLaunch: function () { this._info.launch(); } -} +}; /** * Class used to display two column recent documents in the dash @@ -436,5 +436,9 @@ DashDocDisplay.prototype = { let display = new DashDocDisplayItem(docInfo); this.actor.add_actor(display.actor); } + this.emit('changed'); } -} +}; + +Signals.addSignalMethods(DashDocDisplay.prototype); +