Dialog.set_on_close
-
Here's a nasty thing I could use some help with.
I want to save some data
onbeforeunload. I gavedialog.set_on_closeanexecute_scriptfor js to do that and call the savecallbackin ruby. That works fine when you close the dialog but not when you close Sketchup completely. If you thinkappObserver.onquitwould accommodate this I'll give that a whirl.Thanks.
-
@chrisglasier said:
If you think appObserver.onquit would accommodate this I'll give that a whirl.
If that won't work, try to catch the
unloadevent in JS for the webdialog. -
@thomthom said:
@chrisglasier said:
If you think appObserver.onquit would accommodate this I'll give that a whirl.
If that won't work, try to catch the
unloadevent in JS for the webdialog.Thanks but I don't understand what you mean - js can detect when another application closes?
-
@chrisglasier said:
Thanks but I don't understand what you mean - js can detect when another application closes?
No - but you can detect when the window containing the webpage closes.
But I'm not sure if it'll work with webdialogs - at least not attached to thewindowobject. But I'd put my money on<body onUnload="...">.https://developer.mozilla.org/En/DOM/Window.onunload
http://www.w3schools.com/jsref/event_onunload.asp -
Thanks but onunload doesn't work. I will give the appObserver a try later on.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement