Ero sivun ”Widget:XJwCharts” versioiden välillä
Järvi-meriwikistä
Rivi 20: | Rivi 20: | ||
function readytogo() { | function readytogo() { | ||
− | jQuery( '. | + | jQuery( '.jwChartWidget' ).each( function() { |
var memo = {}; | var memo = {}; | ||
var now = new Date(); | var now = new Date(); | ||
− | + | ||
− | + | memo.widgetEl = jQuery( this ); | |
− | if ( typeof memo. | + | if ( typeof memo.widgetEl.prop( 'id' ) == 'undefined' ) { memo.widgetEl.prop( 'id', 'jwChartWidget_' + now.getTime() ); } |
− | + | memo.widgetEl.css( 'position', 'relative' ); | |
− | + | ||
+ | memo.lang = memo.widgetEl.attr( 'data-lang' ); if (typeof memo.lang == 'undefined') { memo.lang = 'fi'; } | ||
+ | |||
+ | // add chart container | ||
+ | memo.widgetEl.append( '<div class="chart-container" style="position: absolute; z-index: 110; width: 100%; height: 100%;"></div>' ); | ||
+ | memo.chartEl = jQuery( this ).find( '.chart-container' ); | ||
+ | |||
memo.chartEl.append( '<div class="jwloading"></div>' ); | memo.chartEl.append( '<div class="jwloading"></div>' ); | ||
Rivi 40: | Rivi 46: | ||
// add fullscreen button | // add fullscreen button | ||
− | memo. | + | memo.widgetEl.append( '<div class="obschartbutton fullscreen-button" style="Xdisplay: none; position: absolute; z-index: 120; float: right; top: 40px; right: 1.5px; background-color: rgba( 255, 255, 255, .9 ); border-radius: 50%; border: 1px solid rgba( 230, 230, 230, 0.75 ); width: 24px; height: 24px; padding: 0;"><button title="fullscreen" style="width: 24px; height: 24px; padding: 0; margin: 0; background: none; border: none; background-image: url( //www.jarviwiki.fi/widgets/img/fullscreen_16px.png ); background-size: 50%; background-position: center; background-repeat: no-repeat; "></button></div>' ); |
memo.fullscreenEl = jQuery( this ).find( '.fullscreen-button' ); | memo.fullscreenEl = jQuery( this ).find( '.fullscreen-button' ); | ||