Skip to content

Commit 5970e10

Browse files
author
dtbuild
committed
4f65fcf69a8348e89dbea3c053e7323b952dc9dd Add control to the successfully copied message
bbc8e63c0c70e4942b1c3b07d022b5ba52ab9ae4 New: Copy button - Add enablement control to the successfully copied message Merge pull request #208 from Lexachoc/copy_success_control Sync to source repo @bbc8e63c0c70e4942b1c3b07d022b5ba52ab9ae4
1 parent 7ffc785 commit 5970e10

5 files changed

+35
-27
lines changed

datatables.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
],
2626
"src-repo": "http://github.com/DataTables/Buttons",
2727
"last-tag": "3.1.1",
28-
"last-sync": "c863eed3dcf6200ffa23f4917d4eda0c35fc03e4"
28+
"last-sync": "bbc8e63c0c70e4942b1c3b07d022b5ba52ab9ae4"
2929
}

js/buttons.html5.js

+16-12
Original file line numberDiff line numberDiff line change
@@ -967,18 +967,20 @@ DataTable.ext.buttons.copyHtml5 = {
967967
hiddenDiv.remove();
968968

969969
if (successful) {
970-
dt.buttons.info(
971-
dt.i18n('buttons.copyTitle', 'Copy to clipboard'),
972-
dt.i18n(
973-
'buttons.copySuccess',
974-
{
975-
1: 'Copied one row to clipboard',
976-
_: 'Copied %d rows to clipboard'
977-
},
978-
exportData.rows
979-
),
980-
2000
981-
);
970+
if (config.copySuccess) {
971+
dt.buttons.info(
972+
dt.i18n('buttons.copyTitle', 'Copy to clipboard'),
973+
dt.i18n(
974+
'buttons.copySuccess',
975+
{
976+
1: 'Copied one row to clipboard',
977+
_: 'Copied %d rows to clipboard'
978+
},
979+
exportData.rows
980+
),
981+
2000
982+
);
983+
}
982984

983985
cb();
984986
return;
@@ -1035,6 +1037,8 @@ DataTable.ext.buttons.copyHtml5 = {
10351037

10361038
async: 100,
10371039

1040+
copySuccess: true,
1041+
10381042
exportOptions: {},
10391043

10401044
fieldSeparator: '\t',

js/buttons.html5.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/buttons.html5.min.mjs

+1-1
Large diffs are not rendered by default.

js/buttons.html5.mjs

+16-12
Original file line numberDiff line numberDiff line change
@@ -924,18 +924,20 @@ DataTable.ext.buttons.copyHtml5 = {
924924
hiddenDiv.remove();
925925

926926
if (successful) {
927-
dt.buttons.info(
928-
dt.i18n('buttons.copyTitle', 'Copy to clipboard'),
929-
dt.i18n(
930-
'buttons.copySuccess',
931-
{
932-
1: 'Copied one row to clipboard',
933-
_: 'Copied %d rows to clipboard'
934-
},
935-
exportData.rows
936-
),
937-
2000
938-
);
927+
if (config.copySuccess) {
928+
dt.buttons.info(
929+
dt.i18n('buttons.copyTitle', 'Copy to clipboard'),
930+
dt.i18n(
931+
'buttons.copySuccess',
932+
{
933+
1: 'Copied one row to clipboard',
934+
_: 'Copied %d rows to clipboard'
935+
},
936+
exportData.rows
937+
),
938+
2000
939+
);
940+
}
939941

940942
cb();
941943
return;
@@ -992,6 +994,8 @@ DataTable.ext.buttons.copyHtml5 = {
992994

993995
async: 100,
994996

997+
copySuccess: true,
998+
995999
exportOptions: {},
9961000

9971001
fieldSeparator: '\t',

0 commit comments

Comments
 (0)