Fix bug in chrome caused by a nonsense reason

stable
Xavier Julián 2015-02-17 14:35:26 +01:00
parent 3239b8757b
commit c83cc76be8
2 changed files with 12 additions and 16 deletions

View File

@ -235,24 +235,15 @@ EditableWikiContentDirective = ($window, $document, $repo, $confirm, $loading, $
$loading.finish($el.find('.save-container'))
$el.on "mousedown", ".view-wiki-content", (event) ->
# Prepare the scroll movement detection
target = angular.element(event.target)
if target.is('pre')
target.data("scroll-pos", target[0].scrollLeft)
$el.on "mouseup", ".view-wiki-content", (event) ->
# We want to dettect the a inside the div so we use the target and
# not the currentTarget
target = angular.element(event.target)
return if not isEditable()
return if target.is('a', '.codehilite', 'pre')
return if getSelectedText()
return if event.button == 2
if target.is('pre')
prevPos = target.data("scroll-pos")
target.data("scroll-pos", null)
if prevPos != target[0].scrollLeft
return
$el.on "mouseup", ".view-wiki-content", (event) ->
target = angular.element(event.target)
return if getSelectedText()
return if target.is('a')
return if target.is('pre')
switchToEditMode()

View File

@ -48,13 +48,18 @@
line-height: 1.4rem;
margin-bottom: 1rem;
}
.codehilite {
overflow: auto;
}
pre,
code {
@extend %small;
background: $whitish;
background: lighten($grayer, 10%);
color: $whitish;
direction: ltr;
font-family: 'courier new', 'monospace';
margin-bottom: 1rem;
overflow: auto;
unicode-bidi: embed;
white-space: pre;
}