Skip to content

Commit 99bd095

Browse files
committed
fix: replace button text on new X driver
Close #13 Text should be "X" instead of "X.com".
1 parent 36b03b3 commit 99bd095

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/resources/META-INF/resources/frontend/src/fc-sharee-connector.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ import Sharee from 'sharee';
2222
window.fcShareeConnector = {
2323

2424
create: function (container, optionsJson) {
25+
this._updateXButtonLabel();
2526
this._updateCopyDriverOnClick();
2627
let parsedOptions = JSON.parse(optionsJson);
2728
const sharee = new Sharee(container, parsedOptions);
2829
},
2930

3031
createWithCustomDrivers: function (container, optionsJson) {
32+
this._updateXButtonLabel();
3133
this._updateCopyDriverOnClick();
3234
let parsedOptions = JSON.parse(optionsJson);
3335
// add the custom drivers to the list of drivers
@@ -114,5 +116,14 @@ window.fcShareeConnector = {
114116
}, 5000)
115117
});
116118
}
117-
}
119+
},
120+
121+
/*
122+
* Workaround to X driver button text to show only "X" instead "X.com" as in the base component.
123+
*/
124+
_updateXButtonLabel() {
125+
Sharee.drivers['x'].prototype.getButtonText = function () {
126+
return "X";
127+
}
128+
}
118129
}

0 commit comments

Comments
 (0)