Browse Source

Fixed issue with custom label positioning.

pull/4212/head
Gareth Daunton 8 years ago
parent
commit
4473bba9b4
2 changed files with 15 additions and 7 deletions
  1. 20
      src/definitions/modules/range.js
  2. 2
      src/themes/default/modules/range.variables

20
src/definitions/modules/range.js

@ -122,7 +122,14 @@ $.fn.range = function(parameters) {
$children.each(function(index) {
ratio = ((index+1)/(numChildren+1));
position = module.determine.positionFromRatio(ratio);
$(this).css(module.is.reversed() ? 'right' : 'left', position);
var posDir =
module.is.vertical()
?
module.is.reversed() ? 'bottom' : 'top'
:
module.is.reversed() ? 'right' : 'left'
;
$(this).css(posDir, position);
});
},
autoLabel: function() {
@ -135,11 +142,12 @@ $.fn.range = function(parameters) {
for(var i = 0; i <= module.get.numLabels(); i++) {
var
$label = $('<li class="label">' + module.get.label(i+1) + '</li>'),
position = module.is.vertical()
?
module.is.reversed() ? 'bottom' : 'top'
:
module.is.reversed() ? 'right' : 'left'
position =
module.is.vertical()
?
module.is.reversed() ? 'bottom' : 'top'
:
module.is.reversed() ? 'right' : 'left'
;
$label.css(position, module.determine.positionFromValue((i+1) * module.get.step()));
$labels.append($label);

2
src/themes/default/modules/range.variables

@ -50,7 +50,7 @@
--------------------*/
/* Vertical */
@verticalPadding : .5em 1em;
@verticalPadding : .5em 1em;
/* Labeled */
@labelHeight : @height;

Loading…
Cancel
Save