Skip to content

Commit a11e25c

Browse files
committed
Add ghost logo anchor tag
Amends #3736, references #3623 With `button.ghost-logo`, there's no `href`, so cannot be opened in a new window. This changes it back to an anchor and appends the blog URL to a href attribute. Win! Bumps Ghost-UI version to 0.8.13 bring in related CSS changes.
1 parent 1e9db1a commit a11e25c

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"ember-resolver": "git://github.com/stefanpenner/ember-jj-abrams-resolver.git#181251821cf513bb58d3e192faa13245a816f75e",
1111
"ember-simple-auth": "0.6.4",
1212
"fastclick": "1.0.0",
13-
"ghost-ui": "0.8.12",
13+
"ghost-ui": "0.8.13",
1414
"handlebars": "1.3.0",
1515
"ic-ajax": "1.0.1",
1616
"jquery": "1.11.0",

core/client/templates/-navbar.hbs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<header id="global-header" class="navbar">
2-
<button {{action "toggleSidebarOrGoHome" target="view"}} class="ghost-logo">
2+
3+
<button {{action "toggleSidebarOrGoHome" target="view"}} class="ghost-logo ghost-logo-button">
34
<span class="hidden">Ghost</span>
45
</button>
6+
<a class="ghost-logo ghost-logo-link">
7+
<span class="hidden">Ghost</span>
8+
</a>
9+
510
<nav id="global-nav" role="navigation">
611
<ul id="main-menu" >
712
{{gh-activating-list-item route="posts" title="Content" classNames="content js-close-sidebar"}}

core/client/views/application.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
var ApplicationView = Ember.View.extend({
2+
23
setupCloseSidebar: function () {
4+
35
// #### Navigating within the sidebar closes it.
46
$(document).on('click', '.js-close-sidebar', function () {
57
$('body').removeClass('off-canvas');
68
});
9+
10+
// #### Add the blog URL to the <a> version of the ghost logo
11+
$('.ghost-logo-link').attr('href', this.get('controller.ghostPaths').blogRoot);
12+
713
}.on('didInsertElement'),
814

915
actions: {

core/client/views/posts.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ var PostsView = Ember.View.extend({
1515
}
1616
});
1717

18+
// ### Add the blog URL to the <a> version of the ghost logo
19+
$('.ghost-logo-link').attr('href', this.get('controller.ghostPaths').blogRoot);
20+
1821
// ### Show content preview when swiping left on content list
1922
$('.manage').on('click', '.content-list ol li', function (event) {
2023
responsiveAction(event, '(max-width: 800px)', function () {

core/test/functional/client/app_test.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33

44
/*globals CasperTest, casper */
55

6-
CasperTest.begin('Admin navigation bar is correct', 27, function suite(test) {
6+
CasperTest.begin('Admin navigation bar is correct', 29, function suite(test) {
77
casper.thenOpenAndWaitForPageLoad('root', function testTitleAndUrl() {
88
test.assertTitle('Ghost Admin', 'Ghost admin has no title');
99
test.assertUrlMatch(/ghost\/\d+\/$/, 'Landed on the correct URL');
1010
});
1111

1212
casper.then(function testNavItems() {
13-
var contentHref = this.getElementAttribute('#main-menu li.content a', 'href'),
13+
var logoHref = this.getElementAttribute('.ghost-logo-link', 'href'),
14+
contentHref = this.getElementAttribute('#main-menu li.content a', 'href'),
1415
editorHref = this.getElementAttribute('#main-menu li.editor a', 'href'),
1516
settingsHref = this.getElementAttribute('#main-menu li.settings a', 'href');
1617

1718
// Logo
18-
test.assertExists('button.ghost-logo', 'Ghost logo home page button exists');
19+
test.assertExists('.ghost-logo-button', 'Ghost logo home page button exists');
20+
test.assertExists('.ghost-logo-link', 'Ghost logo home page link exists');
21+
test.assertEquals(logoHref, '/', 'Ghost logo link href is correct');
1922

2023
// Content
2124
test.assertExists('#main-menu li.content a', 'Content nav item exists');

0 commit comments

Comments
 (0)