Ero sivun ”Widget:JwObsCharts” versioiden välillä
Järvi-meriwikistä
Rivi 82: | Rivi 82: | ||
memo.headerEl.append( '<div class="obschartbutton fullscreen-button" style="display: none; margin-left: 10px; float: right; Xbackground-color: rgba( 255, 255, 255, 1 ); border-radius: 50%; Xborder: 1px solid rgba( 0, 0, 0, 0.5 ); Xpadding: 1px;"><button title="' + i18n['fullscreen'][memo.lang] + '" style="width: 24px; height: 24px; padding: 0; margin: 0; color: #1B599B; background: none; border: none; "><i class="fas fa-expand"></i></button></div>' ); | memo.headerEl.append( '<div class="obschartbutton fullscreen-button" style="display: none; margin-left: 10px; float: right; Xbackground-color: rgba( 255, 255, 255, 1 ); border-radius: 50%; Xborder: 1px solid rgba( 0, 0, 0, 0.5 ); Xpadding: 1px;"><button title="' + i18n['fullscreen'][memo.lang] + '" style="width: 24px; height: 24px; padding: 0; margin: 0; color: #1B599B; background: none; border: none; "><i class="fas fa-expand"></i></button></div>' ); | ||
memo.fullscreenEl = jQuery( this ).find( '.fullscreen-button' ); | memo.fullscreenEl = jQuery( this ).find( '.fullscreen-button' ); | ||
+ | |||
+ | jQuery( document ).on('webkitfullscreenchange mozfullscreenchange fullscreenchange', function(e) { | ||
+ | |||
+ | if (!document.fullscreenElement) { | ||
+ | |||
+ | memo.chartEl.css( 'height', memo.height + 'px' ); | ||
+ | memo.fullscreenEl.find( 'button' ).html( '<i class="fas fa-expand"></i>' ); | ||
+ | |||
+ | } else { | ||
+ | |||
+ | memo.chartEl.css( 'height', '100%' ); | ||
+ | memo.fullscreenEl.find( 'button' ).html( '<i class="fas fa-compress"></i>' ); | ||
+ | } | ||
+ | |||
+ | //doResize(); | ||
+ | |||
+ | }); | ||
+ | |||
// add edit button | // add edit button | ||
Rivi 122: | Rivi 140: | ||
memo.jw.loadObses( { 'obscode': memo.obscodeParts[0], 'siteid': memo.siteid, 'startdate': memo.startyear + '-01-01', 'custom': custom }, function( o ) { | memo.jw.loadObses( { 'obscode': memo.obscodeParts[0], 'siteid': memo.siteid, 'startdate': memo.startyear + '-01-01', 'custom': custom }, function( o ) { | ||
memo.obses = memo.jw.obs; | memo.obses = memo.jw.obs; | ||
− | |||
drawVisualization(memo); | drawVisualization(memo); | ||
}); | }); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
memo.fullscreenEl.on( 'click', function() { | memo.fullscreenEl.on( 'click', function() { | ||
Rivi 318: | Rivi 318: | ||
} | } | ||
} | } | ||
− | |||
}); | }); |