From 69c9f03b90c11d95b3db04abe037803fef22ffa4 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Thu, 26 Feb 2015 12:02:15 +0100 Subject: [PATCH] fix errors for anonymous users in the wiki --- app/coffee/modules/wiki/main.coffee | 1 + app/styles/layout/wiki.scss | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/coffee/modules/wiki/main.coffee b/app/coffee/modules/wiki/main.coffee index 381c4848..8aad38e7 100644 --- a/app/coffee/modules/wiki/main.coffee +++ b/app/coffee/modules/wiki/main.coffee @@ -238,6 +238,7 @@ EditableWikiContentDirective = ($window, $document, $repo, $confirm, $loading, $ $el.on "mouseup", ".view-wiki-content", (event) -> target = angular.element(event.target) return if getSelectedText() + return if not isEditable() return if target.is('a') return if target.is('pre') diff --git a/app/styles/layout/wiki.scss b/app/styles/layout/wiki.scss index 9bb55308..48cb40ab 100644 --- a/app/styles/layout/wiki.scss +++ b/app/styles/layout/wiki.scss @@ -24,10 +24,6 @@ position: relative; .view-wiki-content { &:hover { - .wysiwyg { - background: $whitish; - cursor: pointer; - } .edit { opacity: 1; top: -1.5rem; @@ -67,4 +63,12 @@ top: .4rem; } } + &.editable { + &:hover { + .wysiwyg { + background: $whitish; + cursor: pointer; + } + } + } }