-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue 04109: Slider description has incorrectly position, when mo…
…ving slider from right to left Dev Fixed slider callout position lag and modified styles for slider left/right text and slider show min/max git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@8432 b72ed6b6-b9f8-46b5-92b4-906544132732
- Loading branch information
Tony Partner
committed
Feb 24, 2010
1 parent
d7351d4
commit 5d05b1d
Showing
31 changed files
with
274 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,66 @@ | ||
// This file will auto convert slider divs to sliders | ||
$(document).ready(function(){ | ||
// call the init slider routine for each element of the .multinum-slider class | ||
$(".multinum-slider").each(function(i,e) { | ||
var basename = e.id.substr(10); | ||
|
||
$(this).prev('label').addClass('slider-label'); //3796 TP - add a class to the labels in slider questions to facilitate styling | ||
|
||
//$("#slider-"+basename).addClass('ui-slider-2'); | ||
//$("#slider-handle-"+basename).addClass('ui-slider-handle2'); | ||
var slider_divisor = $('#slider-param-divisor-' + basename).attr('value'); | ||
var slider_min = $('#slider-param-min-' + basename).attr('value'); | ||
var slider_max = $('#slider-param-max-' + basename).attr('value'); | ||
var slider_stepping = $('#slider-param-stepping-' + basename).attr('value'); | ||
var slider_startvalue = $('#slider-param-startvalue-' + basename).attr('value'); | ||
var slider_onchange = $('#slider-onchange-js-' + basename).attr('value'); | ||
var slider_prefix = $('#slider-prefix-' + basename).attr('value'); | ||
var slider_suffix = $('#slider-suffix-' + basename).attr('value'); | ||
var sliderparams = Array(); | ||
|
||
sliderparams['min'] = slider_min*1; // to force numerical we multiply with 1 | ||
sliderparams['max'] = slider_max*1; // to force numerical we multiply with 1 | ||
// not using the stepping param because it is not smooth | ||
// using Math.round workaround instead | ||
//sliderparams['stepping'] = slider_stepping; | ||
//sliderparams['animate'] = true; | ||
if (slider_startvalue != 'NULL') | ||
{ | ||
sliderparams['value']= slider_startvalue*1; | ||
} | ||
sliderparams['slide'] = function(e, ui) { | ||
//var thevalue = ui.value / slider_divisor; | ||
if ($('#slider-modifiedstate-'+basename).val() ==0) $('#slider-modifiedstate-'+basename).val('1'); | ||
var thevalue = slider_stepping * Math.round(ui.value / slider_stepping) / slider_divisor; | ||
$('#slider-callout-'+basename).css('left', $(ui.handle).css('left')).text(slider_prefix + thevalue + slider_suffix); | ||
}; | ||
sliderparams['stop'] = function(e, ui) { | ||
//var thevalue = ui.value / slider_divisor; | ||
var thevalue = slider_stepping * Math.round(ui.value / slider_stepping) / slider_divisor; | ||
$('#slider-callout-'+basename).css('left', $(ui.handle).css('left')).text(slider_prefix + thevalue + slider_suffix); | ||
}; | ||
|
||
sliderparams['change'] = function(e, ui) { | ||
//var thevalue = ui.value / slider_divisor; | ||
var thevalue = slider_stepping * Math.round(ui.value / slider_stepping) / slider_divisor; | ||
$('#answer'+basename).val(thevalue); | ||
checkconditions( thevalue,'#answer'+basename,'text'); | ||
eval(slider_onchange); | ||
}; | ||
|
||
|
||
$('#slider-'+basename).slider(sliderparams); | ||
|
||
|
||
if (slider_startvalue != 'NULL' && $('#slider-modifiedstate-'+basename).val() !=0) | ||
{ | ||
var thevalue = slider_startvalue / slider_divisor; | ||
$('#slider-callout-'+basename).css('left', $('#slider-handle-'+basename).css('left')).text(slider_prefix + thevalue + slider_suffix); | ||
} | ||
}) | ||
}); | ||
// This file will auto convert slider divs to sliders | ||
$(document).ready(function(){ | ||
// call the init slider routine for each element of the .multinum-slider class | ||
$(".multinum-slider").each(function(i,e) { | ||
var basename = e.id.substr(10); | ||
|
||
$(this).prev('label').addClass('slider-label'); //3796 TP - add a class to the labels in slider questions to facilitate styling | ||
|
||
//$("#slider-"+basename).addClass('ui-slider-2'); | ||
//$("#slider-handle-"+basename).addClass('ui-slider-handle2'); | ||
var slider_divisor = $('#slider-param-divisor-' + basename).attr('value'); | ||
var slider_min = $('#slider-param-min-' + basename).attr('value'); | ||
var slider_max = $('#slider-param-max-' + basename).attr('value'); | ||
var slider_stepping = $('#slider-param-stepping-' + basename).attr('value'); | ||
var slider_startvalue = $('#slider-param-startvalue-' + basename).attr('value'); | ||
var slider_onchange = $('#slider-onchange-js-' + basename).attr('value'); | ||
var slider_prefix = $('#slider-prefix-' + basename).attr('value'); | ||
var slider_suffix = $('#slider-suffix-' + basename).attr('value'); | ||
var sliderparams = Array(); | ||
|
||
sliderparams['min'] = slider_min*1; // to force numerical we multiply with 1 | ||
sliderparams['max'] = slider_max*1; // to force numerical we multiply with 1 | ||
// not using the stepping param because it is not smooth | ||
// using Math.round workaround instead | ||
//sliderparams['stepping'] = slider_stepping; | ||
//sliderparams['animate'] = true; | ||
if (slider_startvalue != 'NULL') | ||
{ | ||
sliderparams['value']= slider_startvalue*1; | ||
} | ||
sliderparams['slide'] = function(e, ui) { | ||
//var thevalue = ui.value / slider_divisor; | ||
if ($('#slider-modifiedstate-'+basename).val() ==0) $('#slider-modifiedstate-'+basename).val('1'); | ||
|
||
function updateCallout() { | ||
var thevalue = slider_stepping * Math.round(ui.value / slider_stepping) / slider_divisor; | ||
$('#slider-callout-'+basename).css('left', $(ui.handle).css('left')).text(slider_prefix + thevalue + slider_suffix); | ||
} | ||
// Delay updating the callout because it was picking up the last postion of the slider | ||
setTimeout(updateCallout, 10); | ||
}; | ||
sliderparams['stop'] = function(e, ui) { | ||
//var thevalue = ui.value / slider_divisor; | ||
var thevalue = slider_stepping * Math.round(ui.value / slider_stepping) / slider_divisor; | ||
$('#slider-callout-'+basename).css('left', $(ui.handle).css('left')).text(slider_prefix + thevalue + slider_suffix); | ||
}; | ||
|
||
sliderparams['change'] = function(e, ui) { | ||
//var thevalue = ui.value / slider_divisor; | ||
var thevalue = slider_stepping * Math.round(ui.value / slider_stepping) / slider_divisor; | ||
$('#answer'+basename).val(thevalue); | ||
checkconditions( thevalue,'#answer'+basename,'text'); | ||
eval(slider_onchange); | ||
}; | ||
|
||
|
||
$('#slider-'+basename).slider(sliderparams); | ||
|
||
|
||
if (slider_startvalue != 'NULL' && $('#slider-modifiedstate-'+basename).val() !=0) | ||
{ | ||
var thevalue = slider_startvalue / slider_divisor; | ||
$('#slider-callout-'+basename).css('left', $('#slider-handle-'+basename).css('left')).text(slider_prefix + thevalue + slider_suffix); | ||
} | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.