Ero sivun ”Widget:JwObsCharts” versioiden välillä
Järvi-meriwikistä
Rivi 1: | Rivi 1: | ||
<includeonly> | <includeonly> | ||
+ | |||
<script type="text/javascript"> | <script type="text/javascript"> | ||
+ | |||
(function() { | (function() { | ||
Rivi 20: | Rivi 22: | ||
if ( typeof window.jwobschart == 'undefined' ) { | if ( typeof window.jwobschart == 'undefined' ) { | ||
− | window.jwobschart = {}; | + | window.jwobschart = { 'memos': [] }; |
css_link = jQuery( "<link>", { rel: "stylesheet", type: "text/css", href: "//www.jarviwiki.fi/embed/css/obschart.css?ver=1" }); | css_link = jQuery( "<link>", { rel: "stylesheet", type: "text/css", href: "//www.jarviwiki.fi/embed/css/obschart.css?ver=1" }); | ||
Rivi 47: | Rivi 49: | ||
window.jwobschart[id] = {}; | window.jwobschart[id] = {}; | ||
− | + | ||
− | var memo = {}; | + | var memo = {}; window.jwobschart.memos.push( memo ); |
memo.widgetEl = jQuery( this ); | memo.widgetEl = jQuery( this ); | ||
Rivi 331: | Rivi 333: | ||
} | } | ||
} | } | ||
+ | |||
+ | jQuery( window ).resize(function() { | ||
+ | console.log( 'resize triggered' ); | ||
+ | doResize( memo ); | ||
+ | }); | ||
+ | |||
}); | }); | ||
} | } | ||
Rivi 1 402: | Rivi 1 410: | ||
}); | }); | ||
− | |||
− | |||
− | |||
− | |||
} else { | } else { | ||
Rivi 1 416: | Rivi 1 420: | ||
} | } | ||
− | + | /* | |
+ | jQuery( window ).resize(function() { | ||
+ | for ( var m in window.jwobschart.memos ) { | ||
+ | console.log( 'resize triggered' ); | ||
+ | doResize( window.jwobschart.memos[ m ] ); | ||
+ | } | ||
+ | }); | ||
+ | */ | ||
function doResize( memo ) { | function doResize( memo ) { | ||