in partnership with mediatemple

Ticket #416 (closed enhancement: invalid)

Opened 9 months ago

Last modified 2 days ago

Slider doesn't support resizing of slider

Reported by: make-contact@… Owned by:
Type: enhancement Priority: trivial
Milestone: Component: Core
Keywords: slider Cc:

Description

I'm working on a web page that uses slider. It's great... except you can't resize the slider (e.g. the slider & knob have percentage widths). The following allows me to, in my window resize event handler resize the slider. sizeSlider() could replace the code block in initialize, in order to save duplication. resizeSlider() is what I call, followed by set() (I call that with either the current value or 0, depending on app requirements).

Slider.prototype.sizeSlider = function() {
	var mod, offset;
	switch(this.options.mode){
		case 'horizontal':
			this.z = 'x';
			this.p = 'left';
			mod = {'x': 'left', 'y': false};
			offset = 'offsetWidth';
			break;
		case 'vertical':
			this.z = 'y';
			this.p = 'top';
			mod = {'x': false, 'y': 'top'};
			offset = 'offsetHeight';
	}
	this.max = this.element[offset] - this.knob[offset] + (this.options.offset * 2);
	this.half = this.knob[offset]/2;
	this.getPos = this.element['get' + this.p.capitalize()].bind(this.element);
	this.knob.setStyle('position', 'relative').setStyle(this.p, - this.options.offset);
	var lim = {};
	lim[this.z] = [- this.options.offset, this.max - this.options.offset];
	return lim;
};

Slider.prototype.resizeSlider = function() {	
	this.drag.options.limit = this.sizeSlider();
};

Change History

Changed 9 months ago by kamicane

not a defect. Slider was never supposed to be resizable.

Changed 8 months ago by kamicane

  • priority changed from minor to trivial
  • type changed from defect to enhancement

Changed 8 months ago by ibolmo

  • milestone changed from Mootools version 1.2 to Mootools version 1.3

Part of the Mootools UI Project.

Changed 2 days ago by tomocchino

  • status changed from new to closed
  • resolution set to invalid
  • component set to Core

slider was never designed to be resizable, the functionality creates too many complications.

Note: See TracTickets for help on using tickets.