datavis-glide 4.0.1 → 4.0.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datavis-glide",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "DataVis GLIDE (Graphical Layer for Interactive Data Exploration)",
5
5
  "keywords": [
6
6
  "data",
@@ -5,7 +5,7 @@ import jQuery from 'jquery';
5
5
 
6
6
  import { trans } from './trans.js';
7
7
  import {
8
- icon,
8
+ makeOperationButton,
9
9
  makeSubclass,
10
10
  mixinLogging,
11
11
  } from './util/misc.js';
@@ -93,20 +93,8 @@ OperationsPalette.prototype.drawPalette = function () {
93
93
  var catLabel = jQuery('<span>').text(c).appendTo(catDiv);
94
94
  }
95
95
  _.each(ops, function (op) {
96
- var btn = jQuery('<button>', {
97
- 'type': 'button',
98
- 'class': 'wcdv_operation',
99
- 'data-operation-index': op.idx
100
- }).appendTo(catDiv);
101
- if (op.label == null) {
102
- btn.addClass('no_label');
103
- }
104
- if (op.icon) {
105
- btn.append(icon(op.icon));
106
- }
107
- if (op.label) {
108
- btn.append(op.label);
109
- }
96
+ var btn = makeOperationButton('all', op, op.idx);
97
+ catDiv.append(btn);
110
98
  });
111
99
  });
112
100
  };
@@ -969,7 +969,10 @@ GridTable.prototype._addSortingToHeader = function (data, orientation, spec, con
969
969
  self.view.clearSort();
970
970
  });
971
971
 
972
- sortIcon_btn.addEventListener('click', function () {
972
+ // Bind with jQuery (not the native addEventListener) so that the handler survives when the
973
+ // TableTool floating-header feature clones the table header via jQuery's clone(true). Native
974
+ // listeners are not copied by clone(true), which would leave the cloned sort icon inert.
975
+ jQuery(sortIcon_btn).on('click', function () {
973
976
  sortIcon_menu.open(sortIcon_btn);
974
977
  });
975
978
 
package/src/util/misc.js CHANGED
@@ -682,10 +682,16 @@ export function makeOperationButton(type, op, index, opts) {
682
682
  }
683
683
  else {
684
684
  if (op.icon) {
685
- btn.appendChild(makeOperationIcon(op));
685
+ var icon = makeOperationIcon(op);
686
+ if (op.label) {
687
+ icon.style.paddingRight = '0.25em';
688
+ }
689
+ btn.setAttribute('data-icon', op.icon);
690
+ btn.appendChild(icon);
686
691
  }
687
692
  if (op.label) {
688
693
  btn.classList.add('wcdv_nowrap');
694
+ btn.setAttribute('aria-label', op.label);
689
695
  btn.append(op.label);
690
696
  }
691
697
  else {
@@ -694,6 +700,7 @@ export function makeOperationButton(type, op, index, opts) {
694
700
  }
695
701
  if (op.tooltip) {
696
702
  btn.setAttribute('title', op.tooltip);
703
+ btn.setAttribute('aria-description', op.tooltip);
697
704
  }
698
705
  return btn;
699
706
  }