Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 00ad035e

Přidáno uživatelem Vít Mazín před více než 5 roky(ů)

Workinig slider (refs #7465)

Zobrazit rozdíly:

sources/imiger-core/src/main/webapp/js/components/filterModalWindow.js
5 5
	constructor() {
6 6
		super();
7 7

  
8
		this._sliderString = "$(\"#slider\").dateRangeSlider({valueLabels:\"change\", step:{days:1}});";
9 8
		this._baseFilterOptions = {
10 9
			nodeType: 'Node type',
11 10
			vertexArchetype: 'Vertex archetype',
......
152 151
		}
153 152

  
154 153
		this._onBaseFilterChange('nodeType');
155

  
156 154
		return this._rootElement;
157 155
	}
158 156

  
......
180 178

  
181 179
		this._dateRangeField = DOM.h('div', {
182 180
			id: "slider"
183
		}, [/*
181
		}, [
184 182
			DOM.h('input', {
185
				type: 'date',
183
				type: 'hidden',
186 184
				name: 'value-from',
185
				id: 'value-from',
187 186
			}),
188
			DOM.t(' - '),
187
			//DOM.t(' - '),
189 188
			DOM.h('input', {
190
				type: 'date',
189
				type: 'hidden',
191 190
				name: 'value-to',
192
			}),*/
191
				id: 'value-to',
192
			}),
193 193
		]);
194 194

  
195 195
		this._showSlider = DOM.h('script', {
196
			id: "sliderScript",
197
		}, [
198
				DOM.t(this._sliderString)
199
			]),
196
				id: "sliderScript",
197
			}, [
198
				DOM.t("$(\"#slider\").dateRangeSlider({valueLabels:\"change\", step:{days:1}});")
199
		]);
200 200

  
201 201
		// number
202 202
		this._numberField = DOM.h('input', {
......
441 441

  
442 442
	setDateBounds(minDate, maxDate) {
443 443
		if(minDate !== null && maxDate !== null) {
444
			this._sliderString = "$(\"#slider\").dateRangeSlider({valueLabels:\"change\", step:{days:1}, bounds:{min: new Date(" + minDate.toString() + "), max: new Date(" + maxDate.toString() + ")}});";
445
			var element = document.getElementById("sliderScript");
444
			this._showSlider = DOM.h('script', {
445
				id: "sliderScript",
446
			}, [
447
				DOM.t("$(\"#slider\").dateRangeSlider({valueLabels:\"change\", step:{days:1}, " +
448
					"bounds:{min: new Date(" + minDate.getTime() + "), max: new Date(" + maxDate.getTime() + ")}, " +
449
					"defaultValues:{min: new Date(" + minDate.getTime() + "), max: new Date(" + maxDate.getTime() + ")}});" +
450

  
451
					" $(\"#slider\").bind(\"valuesChanged\", function(e, data){\n" +
452
					"   document.getElementById(\"value-from\").value = new Date(data.values.min.getTime());" +
453
					"   document.getElementById(\"value-to\").value = new Date(data.values.max.getTime());" +
454
					" });")
455
			]);
446 456
		}
447 457
	}
448 458
}

Také k dispozici: Unified diff