Looking for a code review, as working alone on a project and don't have anyone who could possible help me.
Also I am not an expert in JS, so all help will be appreciated and valued.
The snippet for a radio button selection and flash object initialization:
if ($('.qp-content-right-scroll-panel').is(':visible')) {
var isLiveData = $("input:radio[name=preview-options]").val();
if (type.indexOf('DASHBOARD_LAYOUT') != -1) {
var base = $('.qp-content-right-scroll-panel .layoutContent');
var flashObj = $($.browser.mozilla ? "[name=layoutExternalflash]" :
'#layoutExternalflash', base).get(0);
if (flashObj != undefined && $.isFunction(flashObj.ext_sendLayoutDefinition)) {
//get data from radio buttons
$("input:radio[name=preview-options]").click(function () {
var isLiveData = $(this).val();
flashObj.ext_sendLayoutDefinition(elementId, state, isLiveData);
});
}
} else {
var base = $('.qp-content-right-scroll-panel .chartContent');
var flashObj = $($.browser.mozilla ? "[name=chartExternalflash]" :
'#chartExternalflash', base).get(0);
if (flashObj != undefined && $.isFunction(flashObj.ext_sendChartDefinition)) {
$("input:radio[name=preview-options]").click(function () {
var isLiveData = $(this).val();
flashObj.ext_sendLayoutDefinition(elementId, state, isLiveData);
});
flashObj.ext_sendChartDefinition(elementId, state, isLiveData);
}
}
}