Merge pull request #2726 from keymanapp/fix/developer/2712-crash-switching-template

fix(developer): crash when switching layout templates
This commit is contained in:
Marc Durdin 2020-02-25 20:49:16 +07:00 • committed by GitHub
commit b00a30139a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1328,7 +1328,7 @@ $(function () {
$('.skcontrol.wedge-horz,.skcontrol.wedge-vert,div#btnDelSubKey,input#inpSubKeyCap').css('display', '');
builder.selectedKey().removeClass('selected');
if (key) {
if (key && $(key).length) {
$(key).addClass('selected');
$('.kcontrol.wedge-horz,.kcontrol.wedge-vert,div#btnDelKey,input#inpKeyCap').css('display', 'block');
var rowOffset = $(key).parent().offset();