Index: slider_textfield.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/slider_textfield/slider_textfield.js,v retrieving revision 1.3 diff -u -r1.3 slider_textfield.js --- slider_textfield.js 24 Dec 2008 11:26:10 -0000 1.3 +++ slider_textfield.js 22 Jun 2010 12:53:33 -0000 @@ -18,7 +18,7 @@ settings.stop = function(e, ui) { if (window.calloutVisible == false) { $(this).find('.slider_callout').fadeIn('fast', function() { window.calloutVisible = true;}); - $(this).find('.slider_callout').css('left', ui.handle.css('left')).text(Math.round(ui.value)); + $(this).find('.slider_callout').text(Math.round(ui.value)); } $(this).find('.slider_callout').fadeOut('fast', function() { window.calloutVisible = false; }); @@ -34,7 +34,15 @@ }; settings.slide = function(e, ui) { - $('.slider_callout').css('left', ui.handle.css('left')).text(Math.round(ui.value)); + var slider_marginLeft; + slider_marginLeft = parseInt(settings.width) * ui.value / settings.max; + slider_marginLeft = Math.round(slider_marginLeft); + slider_marginLeft = slider_marginLeft - 10; + slider_calloutMarginLeft = slider_marginLeft - 10; + + $('.slider_callout').css("margin-left", slider_calloutMarginLeft); + $('.slider_callout').text(ui.value); + $(settings.handle).css("margin-left",slider_marginLeft); if (settings.callbacks && settings.callbacks.slide) { try { eval(settings.callbacks.slide)(e, ui); @@ -69,5 +77,11 @@ slider_bar.parents('.fieldset-wrapper').addClass('slider'); slider_bar.width(parseInt(settings.width)).slider(settings); + + var slider_marginLeft; + slider_marginLeft = parseInt(settings.width) * $('#' + elem_id).val() / settings.max; + slider_marginLeft = Math.round(slider_marginLeft); + slider_marginLeft = slider_marginLeft - 10; + $(settings.handle).css("margin-left",slider_marginLeft); }); }); \ No newline at end of file Index: slider_textfield.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/slider_textfield/slider_textfield.module,v retrieving revision 1.5 diff -u -r1.5 slider_textfield.module --- slider_textfield.module 2 Jan 2009 20:22:15 -0000 1.5 +++ slider_textfield.module 22 Jun 2010 12:53:34 -0000 @@ -14,8 +14,8 @@ switch ($path) { case 'admin/help#slider_textfield': $replacements = array( - '!jqp' => 'jQuery Plugin Handler', - '!jqp_link' => l('jQuery Plugin Handler', 'http://drupal.org/project/jpq'), + '!jquery_ui' => 'jQuery UI', + '!jquery_ui_link' => l('jQuery UI', 'http://drupal.org/project/jquery_ui'), '!ui.core' => l('ui core', 'http://ui.jquery.com/download_builder/'), '!ui.slider' => l('ui slider', 'http://ui.jquery.com/download_builder/'), '!download page' => l(t('download page'), 'http://ui.jquery.com/download_builder/'), @@ -24,12 +24,12 @@ '!FAPI' => l('Forms API documentation', 'http://api.drupal.org/api/file/developer/topics/forms_api.html/6'), ); - $output[] = '

'. t('The textfield to slider module depends on the module !jqp_link alongside with the jquery plugins !ui.core and !ui.slider.', $replacements); + $output[] = '

'. t('The textfield to slider module depends on the module !jquery_ui_link alongside with the jquery plugins !ui.core and !ui.slider.', $replacements); $output[] = t('Once installed correctly the module will provide you a form element that can be used to replace common textfields (with a numeric value) with a neat slider.') .'

'; $output[] = '

'. t('Installation') .':

'; $output[] = '