Mercurial > hg > orthanc-stone
changeset 1356:d8bb885e9b0a broker
Checking DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR
to control whether using DOM IDs or CSS selectors when
targeting DOM elements.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 15 Apr 2020 14:54:04 +0200 |
parents | 4971b1c5dfa6 |
children | 0dc5b8a4b3a0 |
files | Framework/Viewport/WebAssemblyViewport.cpp |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Framework/Viewport/WebAssemblyViewport.cpp Wed Apr 15 14:52:53 2020 +0200 +++ b/Framework/Viewport/WebAssemblyViewport.cpp Wed Apr 15 14:54:04 2020 +0200 @@ -211,10 +211,20 @@ } } +#if DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR == 1 +// everything OK..... we're using the new setting +#else +#pragma message("WARNING: DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR is not defined or equal to 0. Stone will use the OLD Emscripten rules for DOM element selection.") +#endif + WebAssemblyViewport::WebAssemblyViewport( const std::string& canvasId, bool enableEmscriptenMouseEvents) : canvasId_(canvasId), +#if DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR == 1 canvasCssSelector_("#" + canvasId), +#else + canvasCssSelector_(canvasId), +#endif interactor_(new DefaultViewportInteractor), enableEmscriptenMouseEvents_(enableEmscriptenMouseEvents) {