@@ -40,7 +40,7 @@ angular.module('rzModule', [])
40
40
/**
41
41
* Slider element wrapped in jqLite
42
42
*
43
- * @type {Element }
43
+ * @type {jqLite }
44
44
*/
45
45
this . element = element ;
46
46
@@ -142,7 +142,7 @@ angular.module('rzModule', [])
142
142
*/
143
143
this . tracking = '' ;
144
144
145
- // Slider DOM elements
145
+ // Slider DOM elements wrapped in jqLite
146
146
this . fullBar = null ; // The whole slider bar
147
147
this . selBar = null ; // Highlight between two handles
148
148
this . minPtr = null ; // Left slider handle
@@ -163,6 +163,8 @@ angular.module('rzModule', [])
163
163
164
164
/**
165
165
* Initialize slider
166
+ *
167
+ * @returns {undefined }
166
168
*/
167
169
init : function ( )
168
170
{
@@ -173,7 +175,7 @@ angular.module('rzModule', [])
173
175
{
174
176
this . scope . rzSliderTranslate = function ( value )
175
177
{
176
- return value ;
178
+ return value . value ;
177
179
} ;
178
180
}
179
181
@@ -237,6 +239,8 @@ angular.module('rzModule', [])
237
239
238
240
/**
239
241
* Set maximum and minimum values for the slider
242
+ *
243
+ * @returns {undefined }
240
244
*/
241
245
setMinAndMax : function ( )
242
246
{
@@ -254,6 +258,8 @@ angular.module('rzModule', [])
254
258
255
259
/**
256
260
* Set the slider children to variables for easy access
261
+ *
262
+ * @returns {undefined }
257
263
*/
258
264
cacheElemHandles : function ( )
259
265
{
@@ -263,70 +269,35 @@ angular.module('rzModule', [])
263
269
264
270
switch ( index )
265
271
{
266
- case 0 :
267
- this . fullBar = _elem ;
268
- break ;
269
- case 1 :
270
- if ( this . range )
271
- {
272
- this . selBar = _elem ;
273
- }
274
- else
275
- {
276
- _elem . remove ( ) ;
277
- }
278
- break ;
279
- case 2 :
280
- this . minPtr = _elem ;
281
- break ;
282
- case 3 :
283
- if ( this . range )
284
- {
285
- this . maxPtr = _elem ;
286
- }
287
- else
288
- {
289
- _elem . remove ( ) ;
290
- }
291
- break ;
292
- case 4 :
293
- this . selBub = _elem ;
294
- break ;
295
- case 5 :
296
- this . flrBub = _elem ;
297
- break ;
298
- case 6 :
299
- this . ceilBub = _elem ;
300
- break ;
301
- case 7 :
302
- this . lowBub = _elem ;
303
- break ;
304
- case 8 :
305
- if ( this . range )
306
- {
307
- this . highBub = _elem ;
308
- }
309
- else
310
- {
311
- _elem . remove ( ) ;
312
- }
313
- break ;
314
- case 9 :
315
- if ( this . range )
316
- {
317
- this . cmbBub = _elem ;
318
- }
319
- else
320
- {
321
- _elem . remove ( ) ;
322
- }
323
- break ;
272
+ case 0 : this . fullBar = _elem ; break ;
273
+ case 1 : this . selBar = _elem ; break ;
274
+ case 2 : this . minPtr = _elem ; break ;
275
+ case 3 : this . maxPtr = _elem ; break ;
276
+ case 4 : this . selBub = _elem ; break ;
277
+ case 5 : this . flrBub = _elem ; break ;
278
+ case 6 : this . ceilBub = _elem ; break ;
279
+ case 7 : this . lowBub = _elem ; break ;
280
+ case 8 : this . highBub = _elem ; break ;
281
+ case 9 : this . cmbBub = _elem ; break ;
324
282
}
283
+
325
284
} , this ) ;
285
+
286
+ // Remove stuff not needed in single slider
287
+ if ( ! this . range )
288
+ {
289
+ this . cmbBub . remove ( ) ;
290
+ this . highBub . remove ( ) ;
291
+ this . maxPtr . remove ( ) ;
292
+ this . selBar . remove ( ) ;
293
+ this . selBub . remove ( ) ;
294
+ }
326
295
} ,
327
296
328
297
/**
329
298
* Calculate dimensions that are dependent on window size
299
+ *
300
+ * @returns {undefined }
330
301
*/
331
302
calcViewDimensions : function ( )
332
303
{
@@ -341,6 +312,8 @@ angular.module('rzModule', [])
341
312
342
313
/**
343
314
* Set positions of slider handles, labels and selection bar
315
+ *
316
+ * @returns {undefined }
344
317
*/
345
318
setPointers : function ( )
346
319
{
@@ -376,7 +349,9 @@ angular.module('rzModule', [])
376
349
} ,
377
350
378
351
/**
379
- * Adjust label positions
352
+ * Adjust label positions and visibility
353
+ *
354
+ * @returns {undefined }
380
355
*/
381
356
adjustLabels : function ( )
382
357
{
@@ -473,7 +448,7 @@ angular.module('rzModule', [])
473
448
* Hide element
474
449
*
475
450
* @param element
476
- * @returns {jQlite } The jqLite
451
+ * @returns {jqLite } The jqLite
477
452
*/
478
453
hideEl : function ( element )
479
454
{
@@ -483,8 +458,8 @@ angular.module('rzModule', [])
483
458
/**
484
459
* Show element
485
460
*
486
- * @param element
487
- * @returns {jQlite } The jqLite
461
+ * @param element The jqLite wrapped DOM element
462
+ * @returns {jqLite } The jqLite
488
463
*/
489
464
showEl : function ( element )
490
465
{
@@ -596,6 +571,8 @@ angular.module('rzModule', [])
596
571
597
572
/**
598
573
* Bind mouse and touch events to slider handles
574
+ *
575
+ * @returns {undefined }
599
576
*/
600
577
bindToInputEvents : function ( )
601
578
{
@@ -611,7 +588,8 @@ angular.module('rzModule', [])
611
588
*
612
589
* @param {Object } pointer The jqLite wrapped DOM element
613
590
* @param {string } ref One of the refLow, refHigh
614
- * @param {Event } event The event
591
+ * @param {Event } event The event
592
+ * @returns {undefined }
615
593
*/
616
594
onStart : function ( pointer , ref , event )
617
595
{
@@ -639,7 +617,8 @@ angular.module('rzModule', [])
639
617
/**
640
618
* onMove event handler
641
619
*
642
- * @param {Event } event The event
620
+ * @param {Event } event The event
621
+ * @returns {undefined }
643
622
*/
644
623
onMove : function ( event )
645
624
{
@@ -679,6 +658,7 @@ angular.module('rzModule', [])
679
658
*
680
659
* @param {Object } pointer The jqLite wrapped DOM element
681
660
* @param {Event } event The event
661
+ * @returns {undefined }
682
662
*/
683
663
onEnd : function ( pointer , event )
684
664
{
@@ -722,8 +702,8 @@ angular.module('rzModule', [])
722
702
'<span class="pointer"></span>' + // 2 Left slider handle
723
703
'<span class="pointer"></span>' + // 3 Right slider handle
724
704
'<span class="bubble selection"></span>' + // 4 Range label
725
- '<span class="bubble limit" ng-bind="rzSliderTranslate(rzSliderFloor)"></span>' + // 5 Floor label
726
- '<span class="bubble limit" ng-bind="rzSliderTranslate(rzSliderCeil)" class="bubble limit"></span>' + // 6 Ceiling label
705
+ '<span class="bubble limit" ng-bind="rzSliderTranslate({value: rzSliderFloor} )"></span>' + // 5 Floor label
706
+ '<span class="bubble limit" ng-bind="rzSliderTranslate({value: rzSliderCeil} )" class="bubble limit"></span>' + // 6 Ceiling label
727
707
'<span class="bubble"></span>' + // 7 Label above left slider handle
728
708
'<span class="bubble"></span>' + // 8 Label above right slider handle
729
709
'<span class="bubble"></span>' , // 9 Range label when the slider handles are close ex. 15 - 17
@@ -744,13 +724,13 @@ angular.module('rzModule', [])
744
724
}
745
725
746
726
// Range label
747
- angular . element ( children [ 4 ] ) . attr ( 'ng-bind' , 'rzSliderTranslate(rzSliderDiff)' ) ;
727
+ angular . element ( children [ 4 ] ) . attr ( 'ng-bind' , 'rzSliderTranslate({value: rzSliderDiff} )' ) ;
748
728
// Label above low slider
749
- angular . element ( children [ 7 ] ) . attr ( 'ng-bind' , 'rzSliderTranslate(' + refLow + ')' ) ;
729
+ angular . element ( children [ 7 ] ) . attr ( 'ng-bind' , 'rzSliderTranslate({value: ' + refLow + '} )' ) ;
750
730
// Label above high slider
751
- angular . element ( children [ 8 ] ) . attr ( 'ng-bind' , 'rzSliderTranslate(' + refHigh + ')' ) ;
731
+ angular . element ( children [ 8 ] ) . attr ( 'ng-bind' , 'rzSliderTranslate({value: ' + refHigh + '} )' ) ;
752
732
// Combined label for low and high
753
- angular . element ( children [ 9 ] ) . attr ( 'ng-bind-html' , 'rzSliderTranslate(' + refLow + ') + " - " + rzSliderTranslate(' + refHigh + ')' ) ;
733
+ angular . element ( children [ 9 ] ) . attr ( 'ng-bind-html' , 'rzSliderTranslate({value: ' + refLow + '} ) + " - " + rzSliderTranslate({value: ' + refHigh + '} )' ) ;
754
734
755
735
return {
756
736
post : function ( scope , elem , attr )
@@ -761,3 +741,14 @@ angular.module('rzModule', [])
761
741
}
762
742
} ;
763
743
} ] ) ;
744
+
745
+ // IDE assist
746
+
747
+ /**
748
+ * @name jqLite
749
+ */
750
+
751
+ /**
752
+ * @name Event
753
+ * @property {Array } touches
754
+ */
0 commit comments