mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
1) Fixed an issue where JSON editor preview colours have inappropriate contrast in dark mode. Fixes #6944
2) Fixed JSON Editor scrolling issue in code mode. Fixes #6945
This commit is contained in:
committed by
Akshay Joshi
parent
a47cbbe26c
commit
e2e5a8208c
@@ -327,6 +327,12 @@ import Alertify from 'pgadmin.alertifyjs';
|
||||
}
|
||||
};
|
||||
|
||||
this.resizeJsoneditorObserver = new ResizeObserver(() => {
|
||||
if ($editor){
|
||||
$editor.resize();
|
||||
}
|
||||
});
|
||||
|
||||
this.save = function() {
|
||||
args.commitChanges();
|
||||
};
|
||||
@@ -352,6 +358,7 @@ import Alertify from 'pgadmin.alertifyjs';
|
||||
};
|
||||
|
||||
this.destroy = function() {
|
||||
this.resizeJsoneditorObserver.unobserve(document.getElementById('pg-json-editor'));
|
||||
$editor.destroy();
|
||||
$wrapper.remove();
|
||||
};
|
||||
@@ -408,6 +415,7 @@ import Alertify from 'pgadmin.alertifyjs';
|
||||
throw(error);
|
||||
}, 'jsoneditorchunk');
|
||||
}
|
||||
this.resizeJsoneditorObserver.observe(document.getElementById('pg-json-editor'));
|
||||
};
|
||||
|
||||
this.serializeValue = function() {
|
||||
@@ -641,6 +649,7 @@ import Alertify from 'pgadmin.alertifyjs';
|
||||
};
|
||||
|
||||
this.destroy = function() {
|
||||
this.resizeJsoneditorObserver.unobserve(document.getElementById('pg-json-editor'));
|
||||
$editor.destroy();
|
||||
$wrapper.remove();
|
||||
};
|
||||
@@ -649,6 +658,13 @@ import Alertify from 'pgadmin.alertifyjs';
|
||||
$editor.focus();
|
||||
};
|
||||
|
||||
// listen to resize event for json editor
|
||||
this.resizeJsoneditorObserver = new ResizeObserver(() => {
|
||||
if ($editor){
|
||||
$editor.resize();
|
||||
}
|
||||
});
|
||||
|
||||
this.loadValue = function(item) {
|
||||
var data = defaultValue = item[args.column.field];
|
||||
tmpdata = data;
|
||||
@@ -689,6 +705,7 @@ import Alertify from 'pgadmin.alertifyjs';
|
||||
}, function(error){
|
||||
throw(error);
|
||||
}, 'jsoneditorchunk');
|
||||
this.resizeJsoneditorObserver.observe(document.getElementById('pg-json-editor'));
|
||||
};
|
||||
|
||||
this.serializeValue = function() {
|
||||
|
||||
@@ -230,7 +230,9 @@ div.jsoneditor td.jsoneditor-tree {
|
||||
}
|
||||
|
||||
pre.jsoneditor-preview{
|
||||
background-color: $color-gray-lighter !important;
|
||||
background-color: $color-gray-lighter !important;
|
||||
opacity: 0.8;
|
||||
color: $color-fg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user