Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data-tem-name attribute to table settings #142

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export default class TableBlock {
return [
{
label: this.api.i18n.t('With headings'),
name: 'with-headings',
icon: IconTableWithHeadings,
isActive: this.data.withHeadings,
closeOnActivate: true,
Expand All @@ -114,6 +115,7 @@ export default class TableBlock {
}
}, {
label: this.api.i18n.t('Without headings'),
name: 'without-headings',
icon: IconTableWithoutHeadings,
isActive: !this.data.withHeadings,
closeOnActivate: true,
Expand Down
6 changes: 6 additions & 0 deletions src/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export default class Table {
items: [
{
label: this.api.i18n.t('Add column to left'),
name: 'column-left',
icon: IconDirectionLeftDown,
onClick: () => {
this.addColumn(this.selectedColumn, true);
Expand All @@ -177,6 +178,7 @@ export default class Table {
},
{
label: this.api.i18n.t('Add column to right'),
name: 'column-right',
icon: IconDirectionRightDown,
onClick: () => {
this.addColumn(this.selectedColumn + 1, true);
Expand All @@ -185,6 +187,7 @@ export default class Table {
},
{
label: this.api.i18n.t('Delete column'),
name: 'delete',
icon: IconCross,
hideIf: () => {
return this.numberOfColumns === 1;
Expand Down Expand Up @@ -218,6 +221,7 @@ export default class Table {
items: [
{
label: this.api.i18n.t('Add row above'),
name: 'row-above',
icon: IconDirectionUpRight,
onClick: () => {
this.addRow(this.selectedRow, true);
Expand All @@ -226,6 +230,7 @@ export default class Table {
},
{
label: this.api.i18n.t('Add row below'),
name: 'row-below',
icon: IconDirectionDownRight,
onClick: () => {
this.addRow(this.selectedRow + 1, true);
Expand All @@ -234,6 +239,7 @@ export default class Table {
},
{
label: this.api.i18n.t('Delete row'),
name: 'delete',
icon: IconCross,
hideIf: () => {
return this.numberOfRows === 1;
Expand Down
1 change: 1 addition & 0 deletions src/utils/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default class Popover {

this.items.forEach((item, index) => {
const itemEl = $.make('div', Popover.CSS.item);
itemEl.setAttribute('data-item-name', item.name);
const icon = $.make('div', Popover.CSS.itemIcon, {
innerHTML: item.icon
});
Expand Down