MCPcopy Index your code
hub / github.com/zxlie/FeHelper / _selectJsonElement

Function _selectJsonElement

apps/json-format/format-lib.js:1148–1169  ·  view source on GitHub ↗
(el, opts)

Source from the content-addressed store, hash-verified

1146 };
1147
1148 let _selectJsonElement = function (el, opts) {
1149 opts = opts || {};
1150 let selected = el && el.length ? el : _getSelectedJsonElement();
1151 if (!selected.length) {
1152 return _getSelectionInfo(selected);
1153 }
1154
1155 _setPlainJsonView(false);
1156 selected.parents('.collapsed').removeClass('collapsed');
1157 $('.x-selected').removeClass('x-selected');
1158 selected.addClass('x-selected');
1159
1160 if (opts.scroll !== false && selected[0] && selected[0].scrollIntoView) {
1161 selected[0].scrollIntoView({block: 'center', inline: 'nearest'});
1162 }
1163
1164 _toogleStatusBar(selected, true);
1165 _addOptForItem(selected, true);
1166 let info = _getSelectionInfo(selected);
1167 _emitSelectionChange(selected);
1168 return info;
1169 };
1170
1171 let _clearSelection = function () {
1172 $('.x-selected').removeClass('x-selected');

Callers 4

_syncStatusBarEnabledFunction · 0.85
_selectSearchMatchFunction · 0.85
_addEventsFunction · 0.85
format-lib.jsFile · 0.85

Calls 7

_getSelectedJsonElementFunction · 0.85
_getSelectionInfoFunction · 0.85
_setPlainJsonViewFunction · 0.85
_toogleStatusBarFunction · 0.85
_addOptForItemFunction · 0.85
_emitSelectionChangeFunction · 0.85
$Function · 0.50

Tested by

no test coverage detected