Merge pull request #349 from taigaio/issue/2251/scroll-code

Remove wiki edition ir pre or secondary click
stable
Juanfran 2015-02-17 06:03:37 -08:00
commit 28ec275cca
2 changed files with 12 additions and 15 deletions

View File

@ -235,23 +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')
return if event.button == 2
$el.on "mouseup", ".view-wiki-content", (event) ->
target = angular.element(event.target)
return if getSelectedText()
if target.is('pre')
prevPos = target.data("scroll-pos")
target.data("scroll-pos", null)
if prevPos != target[0].scrollLeft
return
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;
}