Merge pull request #349 from taigaio/issue/2251/scroll-code
Remove wiki edition ir pre or secondary clickstable
commit
28ec275cca
|
@ -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()
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue