Merge pull request #3749 from novaugust/ghost-logo-link

Update ghost-logo, amend the amdendments, death to jQuery
This commit is contained in:
Hannah Wolfe 2014-08-14 20:19:00 +01:00
commit ec05c703ec
3 changed files with 6 additions and 20 deletions

View File

@ -1,9 +1,9 @@
<header id="global-header" class="navbar">
<button {{action "toggleSidebarOrGoHome" target="view"}} class="ghost-logo ghost-logo-button">
<button {{action "toggleSidebar" target="view"}} class="ghost-logo ghost-logo-button">
<span class="hidden">Ghost</span>
</button>
<a class="ghost-logo ghost-logo-link">
<a class="ghost-logo ghost-logo-link" {{bind-attr href=view.blogRoot}}>
<span class="hidden">Ghost</span>
</a>

View File

@ -1,27 +1,16 @@
var ApplicationView = Ember.View.extend({
blogRoot: Ember.computed.alias('controller.ghostPaths.blogRoot'),
setupCloseSidebar: function () {
// #### Navigating within the sidebar closes it.
$(document).on('click', '.js-close-sidebar', function () {
$('body').removeClass('off-canvas');
});
// #### Add the blog URL to the <a> version of the ghost logo
$('.ghost-logo-link').attr('href', this.get('controller.ghostPaths').blogRoot);
}.on('didInsertElement'),
actions: {
//Sends the user to the front if they're not on mobile,
//otherwise toggles the sidebar.
toggleSidebarOrGoHome: function () {
if (window.matchMedia('(max-width: 650px)').matches) {
$('body').toggleClass('off-canvas');
}
else {
window.location = this.get('controller.ghostPaths').blogRoot;
}
toggleSidebar: function () {
$('body').toggleClass('off-canvas');
}
}
});

View File

@ -15,9 +15,6 @@ var PostsView = Ember.View.extend({
}
});
// ### Add the blog URL to the <a> version of the ghost logo
$('.ghost-logo-link').attr('href', this.get('controller.ghostPaths').blogRoot);
// ### Show content preview when swiping left on content list
$('.manage').on('click', '.content-list ol li', function (event) {
responsiveAction(event, '(max-width: 800px)', function () {