OHIF-127: Resizing viewport when window gets resized
This commit is contained in:
1 parent
553eb9e24e
commit
12862aec51
2 files changed
+14
-4
No files matched your search
@@ -111,11 +111,16 @@ Template.cineDialog.onCreated(() => {
|
||||
* ... jQuery's on('resize', func) version which, for some unkown reason
|
||||
* ... is currently not working for this portion of code.
|
||||
* ... Further investigation is necessary.
|
||||
*
|
||||
* This happens because when an event is attached using jQuery's
|
||||
* you can't get it using vanilla JavaScript, it returns null.
|
||||
* You need to use jQuery for that. So, either you use vanilla JS or jQuery
|
||||
* to get an element's event handler. See viewerMain for more details.
|
||||
*/
|
||||
|
||||
instance.setResizeHandler = (handler) => {
|
||||
instance.setResizeHandler = handler => {
|
||||
if (typeof handler === 'function') {
|
||||
let origHandler = window.onresize;
|
||||
const origHandler = window.onresize;
|
||||
instance.origWindowResizeHandler = typeof origHandler === 'function' ? origHandler : null;
|
||||
window.onresize = function (event) {
|
||||
if (typeof origHandler === 'function') {
|
||||
|
||||
Reference in new issue
Block a user