Some more fixes around #558
This commit is contained in:
parent
21199eb9e0
commit
46593c24c5
|
@ -272,7 +272,7 @@ treemode.getName = function () {
|
|||
* - to the first button in the top menu
|
||||
*/
|
||||
treemode.focus = function () {
|
||||
var input = this.content.querySelector('[contenteditable=true]');
|
||||
var input = this.scrollableContent.querySelector('[contenteditable=true]');
|
||||
if (input) {
|
||||
input.focus();
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ treemode.refresh = function () {
|
|||
*/
|
||||
treemode.startAutoScroll = function (mouseY) {
|
||||
var me = this;
|
||||
var content = this.content;
|
||||
var content = this.scrollableContent;
|
||||
var top = util.getAbsoluteTop(content);
|
||||
var height = content.clientHeight;
|
||||
var bottom = top + height;
|
||||
|
@ -569,9 +569,9 @@ treemode.setDomSelection = function (selection) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ('scrollTop' in selection && this.content) {
|
||||
if ('scrollTop' in selection && this.scrollableContent) {
|
||||
// TODO: animated scroll
|
||||
this.content.scrollTop = selection.scrollTop;
|
||||
this.scrollableContent.scrollTop = selection.scrollTop;
|
||||
}
|
||||
if (selection.nodes) {
|
||||
// multi-select
|
||||
|
@ -604,7 +604,7 @@ treemode.getDomSelection = function () {
|
|||
dom: this.focusTarget,
|
||||
range: range,
|
||||
nodes: this.multiselection.nodes.slice(0),
|
||||
scrollTop: this.content ? this.content.scrollTop : 0
|
||||
scrollTop: this.scrollableContent ? this.scrollableContent.scrollTop : 0
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
<link href="../dist/jsoneditor.css" rel="stylesheet" type="text/css">
|
||||
<script src="../dist/jsoneditor.js"></script>
|
||||
|
||||
<!--<script src="https://unpkg.com/mobius1-selectr@2.4.1/dist/selectr.min.js"></script>-->
|
||||
<!--<link rel="stylesheet" type="text/css" href="https://unpkg.com/mobius1-selectr@2.4.1/dist/selectr.min.css">-->
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
font: 10.5pt arial;
|
||||
|
|
Loading…
Reference in New Issue