Skip to content

Commit 205f943

Browse files
author
minjk-bl
committed
Fix Seaborn bug on x,yticks label
1 parent 3f02742 commit 205f943

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

visualpython/js/m_visualize/Seaborn.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -361,29 +361,33 @@ define([
361361
let val = $(this).val();
362362
if (val !== '') {
363363
// enable xticks_label
364-
$(that.wrapSelector('#xticks_label')).prop('readonly', false);
364+
$(that.wrapSelector('#xticks_label')).attr('readonly', false);
365365
} else {
366366
// disable xticks_label
367-
$(that.wrapSelector('#xticks_label')).prop('readonly', true);
367+
$(that.wrapSelector('#xticks_label')).attr('readonly', true);
368368
}
369369
});
370370
$(this.wrapSelector('#yticks')).on('change', function() {
371371
let val = $(this).val();
372372
if (val !== '') {
373373
// enable yticks_label
374-
$(that.wrapSelector('#yticks_label')).prop('readonly', false);
374+
$(that.wrapSelector('#yticks_label')).attr('readonly', false);
375375
} else {
376376
// disable yticks_label
377-
$(that.wrapSelector('#yticks_label')).prop('readonly', true);
377+
$(that.wrapSelector('#yticks_label')).attr('readonly', true);
378378
}
379379
});
380380

381381
// axes - ticks label: inform user to type location option to use label
382-
$(this.wrapSelector('#xticks_label[readonly]')).on('click', function() {
383-
$(that.wrapSelector('#xticks')).focus();
382+
$(this.wrapSelector('#xticks_label')).on('click', function() {
383+
if ($(that.wrapSelector('#xticks')).val() === '') {
384+
$(that.wrapSelector('#xticks')).focus();
385+
}
384386
});
385-
$(this.wrapSelector('#yticks_label[readonly]')).on('click', function() {
386-
$(that.wrapSelector('#yticks')).focus();
387+
$(this.wrapSelector('#yticks_label')).on('click', function() {
388+
if ($(that.wrapSelector('#yticks')).val() === '') {
389+
$(that.wrapSelector('#yticks')).focus();
390+
}
387391
});
388392

389393
// preview refresh

0 commit comments

Comments
 (0)