mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-26 10:40:19 -06:00
1) Ensure Boolean columns should be editable using keyboard keys. Fixes #3778
2) Ensure Boolean columns should be editable in View/Edit data and Query Tool. Fixes #4487
This commit is contained in:
parent
dbbbb2e5ed
commit
06ad6b8ba8
@ -23,7 +23,9 @@ Bug fixes
|
||||
|
||||
| `Issue #2706 <https://redmine.postgresql.org/issues/2706>`_ - Added ProjectSet icon for explain module.
|
||||
| `Issue #2828 <https://redmine.postgresql.org/issues/2828>`_ - Added Gather Merge, Named Tuple Store Scan and Table Function Scan icon for explain module.
|
||||
| `Issue #3778 <https://redmine.postgresql.org/issues/3778>`_ - Ensure Boolean columns should be editable using keyboard keys.
|
||||
| `Issue #4419 <https://redmine.postgresql.org/issues/4419>`_ - Fix a debugger error when using Python 2.7.
|
||||
| `Issue #4487 <https://redmine.postgresql.org/issues/4487>`_ - Ensure Boolean columns should be editable in View/Edit data and Query Tool.
|
||||
| `Issue #4577 <https://redmine.postgresql.org/issues/4577>`_ - Fix an error that could be seen when click on any system column of a table.
|
||||
| `Issue #4584 <https://redmine.postgresql.org/issues/4584>`_ - Unescape HTML entities in database names in the Query Tool title bar.
|
||||
| `Issue #4643 <https://redmine.postgresql.org/issues/4643>`_ - Fix Truncate option deselect issue for compound triggers.
|
||||
|
@ -886,25 +886,33 @@ import gettext from 'sources/gettext';
|
||||
// Custom checkbox editor, We need it for runtime as it does not render
|
||||
// indeterminate checkbox state
|
||||
function pgCheckboxEditor(args) {
|
||||
var $select, el;
|
||||
var $select;
|
||||
var defaultValue, previousState;
|
||||
|
||||
this.init = function() {
|
||||
$select = $('<div class=\'multi-checkbox\'><span class=\'check\' hideFocus></span></div>');
|
||||
$select = $('<div class=\'multi-checkbox\' tabindex="0"><span class=\'check\' hideFocus></span></div>');
|
||||
$select.appendTo(args.container);
|
||||
$select.trigger('focus');
|
||||
|
||||
$select.on('click', this.changeValue);
|
||||
|
||||
$select.on('keydown', (e) => {
|
||||
if (e.which == $.ui.keyCode.SPACE) {
|
||||
e.preventDefault();
|
||||
this.changeValue(e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.changeValue = function() {
|
||||
// The following code is taken from https://css-tricks.com/indeterminate-checkboxes/
|
||||
$select.on('click', function() {
|
||||
el = $(this);
|
||||
var states = ['unchecked', 'partial', 'checked'];
|
||||
var curState = el.find('.check').data('state');
|
||||
var curState = $select.find('.check').data('state') || 0;
|
||||
curState++;
|
||||
el.find('.check')
|
||||
$select.find('.check')
|
||||
.removeClass('unchecked partial checked')
|
||||
.addClass(states[curState % states.length])
|
||||
.data('state', curState % states.length);
|
||||
});
|
||||
};
|
||||
|
||||
this.destroy = function() {
|
||||
|
Loading…
Reference in New Issue
Block a user