Skip to content

Commit

Permalink
Merging from wilsonhut to master after manual merge
Browse files Browse the repository at this point in the history
  • Loading branch information
simeydotme committed Apr 11, 2014
1 parent 51315f4 commit 1e98b13
Showing 1 changed file with 21 additions and 32 deletions.
53 changes: 21 additions & 32 deletions src/js/jquery-ui-slider-pips.js
@@ -1,5 +1,3 @@
/* jquery slider pips plugin, version 1.1 */

(function($) {

var extensionMethods = {
Expand All @@ -23,8 +21,14 @@
prefix: "",
// "", string

suffix: ""
suffix: "",
// "", string

formatLabel: function(value) {
return options.prefix + value + options.suffix;
}
// function
// must return a value to display in the pip labels

};

Expand All @@ -43,7 +47,6 @@

// for every stop in the slider; we create a pip.
for( var i=0; i<=pips; i++ ) {


// create the label name, it's either the item in the array, or a number.
var label;
Expand All @@ -58,12 +61,11 @@
label = "";
}


// hold a span element for the pip
var pipHtml =
"<span class=\"ui-slider-pip ui-slider-pip-"+i+"\">"+
"<span class=\"ui-slider-line\"></span>"+
"<span class=\"ui-slider-label\">"+ options.prefix + label + options.suffix +"</span>"+
"<span class=\"ui-slider-label\">"+ options.formatLabel(label) +"</span>"+
"</span>";

var $pip = $(pipHtml);
Expand All @@ -90,7 +92,6 @@

}


// if it's a horizontal slider we'll set the left offset,
// and the top if it's vertical.
if( slider.options.orientation === "horizontal" ) {
Expand All @@ -103,7 +104,6 @@

}


// append the span to the slider.
slider.element.append( $pip );

Expand All @@ -116,12 +116,10 @@

$.extend(true, $["ui"]["slider"].prototype, extensionMethods);


})(jQuery);



/* jquery slider float plugin, version 1.1 */


(function($) {

Expand All @@ -143,9 +141,15 @@
prefix: "",
// "", string

suffix: ""
suffix: "",
// "", string

formatLabel: function(value) {
return options.prefix + value + options.suffix;
}
// function
// must return a value to display in the floats

};

$.extend( options, settings );
Expand Down Expand Up @@ -199,8 +203,8 @@
}

$tip = [
$("<span class=\"ui-slider-tip\">"+ options.prefix + vals[0] + options.suffix +"</span>"),
$("<span class=\"ui-slider-tip\">"+ options.prefix + vals[1] + options.suffix +"</span>")
$("<span class=\"ui-slider-tip\">"+ options.formatLabel(vals[0]) +"</span>"),
$("<span class=\"ui-slider-tip\">"+ options.formatLabel(vals[1]) +"</span>")
];

// else if its just a normal slider
Expand All @@ -223,7 +227,7 @@


// create a tip element
$tip = $("<span class=\"ui-slider-tip\">"+ options.prefix + val + options.suffix +"</span>");
$tip = $("<span class=\"ui-slider-tip\">"+ options.formatLabel(val) +"</span>");

}

Expand Down Expand Up @@ -266,7 +270,7 @@

}

$(ui.handle).find(".ui-slider-tip").html( options.prefix + val + options.suffix );
$(ui.handle).find(".ui-slider-tip").html( options.formatLabel(val) );

});

Expand All @@ -279,19 +283,4 @@
$.extend(true, $["ui"]["slider"].prototype, extensionMethods);


})(jQuery);















})(jQuery);

0 comments on commit 1e98b13

Please sign in to comment.