File tree Expand file tree Collapse file tree 3 files changed +23
-23
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 3 files changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ qx.Class.define("osparc.dashboard.ToggleButtonContainer", {
9595 } ,
9696
9797 areMoreResourcesRequired : function ( loadingResourcesBtn ) {
98- if ( this . nextRequest !== null && loadingResourcesBtn && osparc . utils . Utils . checkIsOnScreen ( loadingResourcesBtn ) ) {
98+ if ( this . nextRequest !== null && loadingResourcesBtn && osparc . utils . Utils . isWidgetOnScreen ( loadingResourcesBtn ) ) {
9999 return true ;
100100 }
101101 return false ;
Original file line number Diff line number Diff line change @@ -287,27 +287,27 @@ qx.Class.define("osparc.utils.Utils", {
287287 return title ;
288288 } ,
289289
290- checkIsOnScreen : function ( elem ) {
291- const isInViewport = element => {
292- if ( element ) {
293- const rect = element . getBoundingClientRect ( ) ;
294- const html = document . documentElement ;
295- return (
296- rect . width > 0 &&
297- rect . height > 0 &&
298- rect . top >= 0 &&
299- rect . left >= 0 &&
300- // a bit of tolerance to deal with zooming factors
301- rect . bottom * 0.95 <= ( window . innerHeight || html . clientHeight ) &&
302- rect . right * 0.95 <= ( window . innerWidth || html . clientWidth )
303- ) ;
304- }
305- return false ;
306- } ;
290+ isElementOnScreen : function ( element ) {
291+ if ( element ) {
292+ const rect = element . getBoundingClientRect ( ) ;
293+ const html = document . documentElement ;
294+ return (
295+ rect . width > 0 &&
296+ rect . height > 0 &&
297+ rect . top >= 0 &&
298+ rect . left >= 0 &&
299+ // a bit of tolerance to deal with zooming factors
300+ rect . bottom * 0.95 <= ( window . innerHeight || html . clientHeight ) &&
301+ rect . right * 0.95 <= ( window . innerWidth || html . clientWidth )
302+ ) ;
303+ }
304+ return false ;
305+ } ,
307306
308- const domElem = elem . getContentElement ( ) . getDomElement ( ) ;
309- const checkIsOnScreen = isInViewport ( domElem ) ;
310- return checkIsOnScreen ;
307+ isWidgetOnScreen : function ( widget ) {
308+ const domElem = widget . getContentElement ( ) . getDomElement ( ) ;
309+ const isWidgetOnScreen = this . isElementOnScreen ( domElem ) ;
310+ return isWidgetOnScreen ;
311311 } ,
312312
313313 growSelectBox : function ( selectBox , maxWidth ) {
Original file line number Diff line number Diff line change @@ -413,8 +413,8 @@ qx.Class.define("osparc.widget.logger.LoggerView", {
413413 __updateTable : function ( ) {
414414 if ( this . __loggerModel ) {
415415 this . __loggerModel . reloadData ( ) ;
416- // checkIsOnScreen will avoid rendering every single line when the user click on the Logger button the first time
417- if ( ! this . isLockLogs ( ) && osparc . utils . Utils . checkIsOnScreen ( this . __loggerTable ) ) {
416+ // isWidgetOnScreen will avoid rendering every single line when the user click on the Logger button the first time
417+ if ( ! this . isLockLogs ( ) && osparc . utils . Utils . isWidgetOnScreen ( this . __loggerTable ) ) {
418418 const nFilteredRows = this . __loggerModel . getFilteredRowCount ( ) ;
419419 this . __loggerTable . scrollCellVisible ( 0 , nFilteredRows ) ;
420420 }
You can’t perform that action at this time.
0 commit comments