Skip to content

Commit

Permalink
Remove custom buttons via API
Browse files Browse the repository at this point in the history
  • Loading branch information
eviewer committed Dec 6, 2021
1 parent a5f873e commit 0dc0a5b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"homepage": "/reactappnpmdemo",
"dependencies": {
"@mstechusa/eviewer7": "^7.0.141",
"@mstechusa/eviewer7": "^7.0.145",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.8.1",
Expand Down
54 changes: 54 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,11 +545,62 @@ class App extends Component {

case "changeButtonState":
this.changeCustomButtonState();
break;
case "removeButton":
this.removeButton();
break;
default:
break;
}
};

removeButton = () => {
this.eViewerObj.removeButtons([
{
id: "leftdummybt",
name: "Left Dummy",
alignment: "leftToolbar",
iconUrl: "assets/images/mst/custBtn1.png",
parent: "",
},
{
id: "rightDummydt",
name: "Right Dummy",
alignment: "rightToolbar",
iconUrl: "assets/images/mst/custBtn1.png",
parent: "",
},
{
id: "ribbonDummyViewbt",
name: "View Dummy",
alignment: "ribbonToolbar",
iconUrl: "assets/images/mst/custBtn1.png",
parent: "View",
},
{
id: "ribbonDummyInsertbt",
name: "Insert Dummy",
alignment: "ribbonToolbar",
iconUrl: "assets/images/mst/custBtn1.png",
parent: "Insert",
},
{
id: "ribbonDummyAnnotatebt",
name: "Annotate Dummy",
alignment: "ribbonToolbar",
iconUrl: "assets/images/mst/custBtn1.png",
parent: "Annotate",
},
{
id: "ribbonDummyRedactbt",
name: "Redact Dummy",
alignment: "ribbonToolbar",
iconUrl: "assets/images/mst/custBtn1.png",
parent: "Redact",
},
]);
};

changeCustomButtonState = () => {
this.eViewerObj.updateButtons([
{
Expand Down Expand Up @@ -1208,6 +1259,9 @@ class App extends Component {
<option className="text-dark" value="changeButtonState">
Update Custom Button State
</option>
<option className="text-dark" value="removeButton">
Remove Button
</option>
</select>
</div>
{this.state.isUploadDivShow === true ? (
Expand Down

0 comments on commit 0dc0a5b

Please sign in to comment.