Properties
Category
English
Similar Topics
Statistics
Comments
4
Participants
3
Subscribers
1
Votes
1
Views
1021
Share
Answered
Is it possible to allow an object to be allowed to be moved, but not be allowed to be deleted?
Thanks.
- GeoGebra
- Help
- Partners
-
Contact us
- Feedback & Questions
- This email address is being protected from spambots. You need JavaScript enabled to view it.
- +43 677 6137 2693
© 2022 International GeoGebra Institute
Yes
See here for example
http://tube.geogebra.org/m/1339417
The problem is once I introduce the delete tool from the toolbar I can still delete that object in the worksheet.
http://tube.geogebra.org/b/...
For example for this worksheet I still want the user to have a delete button in case they mess up, but I don't want them to be able to delete 'S', but I still need it to be moved up and down the line.
So... don't put the delete tool...
They have do/undo buttons... It is enough !!!
Sometimes you need the delete tool. Particularly now with Geogebra Classroom, because student applets are automatically saved. If they go to another applet and then come back to it, they won't be able to use "undo" go get rid of anything.
Below is a solution that you can copy into Global Javascript that will solve the problem. Just replace the name of the object inside the quotation marks where it says "nameOfObject". Anytime someone tries to delete the object, it will automatically undo so they can't delete it.
function ggbOnInit() {
ggbApplet.registerRemoveListener("undoDelete");
}
function undoDelete(obj) {
if (obj == "nameOfObject") {
ggbApplet.undo();
}
}
Comments have been locked on this page!