jclic 2.1.25 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -264,7 +264,7 @@ export class TextActivityBasePanel extends ActivityPanel {
264
264
 
265
265
  // Catch on-demand popups with `F1`, cancel with `Escape`
266
266
  if ($popup !== null && target.infoMode === 'onDemand') {
267
- $span.keydown(ev => {
267
+ $span.on('keydown', ev => {
268
268
  if (ev.key === target.popupKey) {
269
269
  ev.preventDefault();
270
270
  this.showPopup($popup, target.popupMaxTime, target.popupDelay);
@@ -374,7 +374,7 @@ export class TextActivityBasePanel extends ActivityPanel {
374
374
 
375
375
  const prevScreenEnd = () => {
376
376
  this.showingPrevScreen = false;
377
- this.$div.unbind('click');
377
+ this.$div.off('click');
378
378
  if (this.prevScreenTimer) {
379
379
  window.clearTimeout(this.prevScreenTimer);
380
380
  this.prevScreenTimer = null;
@@ -432,7 +432,7 @@ export class TextActivityBasePanel extends ActivityPanel {
432
432
  this.$checkButton.prop('disabled', true);
433
433
  this.targets.forEach(t => {
434
434
  if (t.$comboList)
435
- t.$comboList.attr('disabled', true);
435
+ t.$comboList.prop('disabled', true);
436
436
  });
437
437
  this.showPopup(null);
438
438
  super.finishActivity(result);
@@ -464,7 +464,7 @@ export class WrittenAnswerPanel extends ActivityPanel {
464
464
  if (bx)
465
465
  this.currentCell = bx.idLoc;
466
466
  this.$textField.val('');
467
- this.$textField.focus();
467
+ this.$textField.trigger('focus');
468
468
  this.invalidate().update();
469
469
  if (bx)
470
470
  bx.playMedia(this.ps, delayedActions);
@@ -491,7 +491,7 @@ export class WrittenAnswerPanel extends ActivityPanel {
491
491
 
492
492
  // Avoid clicks on the text field
493
493
  if (this.bgB.contains(p)) {
494
- this.$textField.focus();
494
+ this.$textField.trigger('focus');
495
495
  break;
496
496
  }
497
497
 
@@ -154,7 +154,7 @@ export class CrossWordPanel extends ActivityPanel {
154
154
  'background-image': `url(${type === 'acrossClues' ? this.hIcon : this.vIcon})`,
155
155
  'background-repeat': 'no-repeat',
156
156
  'background-position': 'center',
157
- 'border-radius': 6,
157
+ 'border-radius': '6px',
158
158
  'z-index': 10
159
159
  }).on('click', () => {
160
160
  this.advance = type === 'acrossClues' ?
@@ -247,7 +247,7 @@ export class CrossWordPanel extends ActivityPanel {
247
247
  this.setAndPlayMsg('initial', 'start');
248
248
  this.invalidate().update();
249
249
  this.$div.attr("tabindex", 0);
250
- this.$div.focus();
250
+ this.$div.trigger('focus');
251
251
  this.playing = true;
252
252
  }
253
253
  }
@@ -723,9 +723,9 @@ export class ActiveBox extends AbstractBox {
723
723
  disabled = this.isInactive() && !this.accessibleAlwaysActive;
724
724
  this.$accessibleElement = $('<button/>', {
725
725
  tabindex: disabled ? -1 : 0,
726
- id: `AE${id}`,
727
- disabled: disabled
726
+ id: `AE${id}`
728
727
  })
728
+ .prop('disabled', disabled ? true : null)
729
729
  .html(this.toString())
730
730
  .on('click', ev => {
731
731
  // Check if event was produced by a mouse click
package/src/skins/Skin.js CHANGED
@@ -735,10 +735,8 @@ export class Skin extends Container {
735
735
  * @param {boolean} enabled
736
736
  */
737
737
  setEnabled($object, enabled) {
738
- if ($object && enabled)
739
- $object.removeAttr('disabled');
740
- else if ($object)
741
- $object.attr('disabled', true);
738
+ if ($object)
739
+ $object.prop('disabled', enabled ? null : true);
742
740
  }
743
741
 
744
742
  /**