glider-rails 0.1.4.2 → 0.1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  ###
2
- glider 0.1.4.2 - AngularJS slider
2
+ glider 0.1.4.3 - AngularJS slider
3
3
  https://github.com/evrone/glider
4
4
  Copyright (c) 2013 Valentin Vasilyev, Dmitry Karpunin
5
5
  Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
@@ -57,6 +57,9 @@ gliderModule.directive 'slider', ['$document', ($document) ->
57
57
 
58
58
  link: (scope, element, attrs) ->
59
59
 
60
+ bound = (value, min, max) ->
61
+ Math.min(Math.max(min, value), max)
62
+
60
63
  parseIncrements = ->
61
64
  return unless attrs.increments?
62
65
  min = scope.min()
@@ -87,7 +90,7 @@ gliderModule.directive 'slider', ['$document', ($document) ->
87
90
  scope.xPosition = 0
88
91
  else
89
92
  scope.xPosition = (scope.value - scope.min()) / range * 100
90
- scope.xPosition = Math.min(Math.max(0, scope.xPosition), 100)
93
+ scope.xPosition = bound(scope.xPosition, 0, 100)
91
94
  scope.handleValue = scope.value if scope.showValueInHandle
92
95
 
93
96
  snap = ->
@@ -119,7 +122,7 @@ gliderModule.directive 'slider', ['$document', ($document) ->
119
122
  if scope.min() <= newVal <= scope.max()
120
123
  refreshHandle()
121
124
  else
122
- newVal = oldVal
125
+ scope.value = bound(newVal, scope.min(), scope.max())
123
126
 
124
127
  scope.step = (steps) ->
125
128
  doStep = (steps)->
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 1.6.3
2
2
  /*
3
- glider 0.1.4.2 - AngularJS slider
3
+ glider 0.1.4.3 - AngularJS slider
4
4
  https://github.com/evrone/glider
5
5
  Copyright (c) 2013 Valentin Vasilyev, Dmitry Karpunin
6
6
  Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
@@ -39,7 +39,10 @@
39
39
  max: "&"
40
40
  },
41
41
  link: function(scope, element, attrs) {
42
- var deferUpdate, dragging, parseIncrements, refreshHandle, sliderElement, snap, startPointX, step, valueFromPosition;
42
+ var bound, deferUpdate, dragging, parseIncrements, refreshHandle, sliderElement, snap, startPointX, step, valueFromPosition;
43
+ bound = function(value, min, max) {
44
+ return Math.min(Math.max(min, value), max);
45
+ };
43
46
  parseIncrements = function() {
44
47
  var i, max, min, offsetK, _i, _len, _ref;
45
48
  if (attrs.increments == null) {
@@ -85,7 +88,7 @@
85
88
  scope.xPosition = 0;
86
89
  } else {
87
90
  scope.xPosition = (scope.value - scope.min()) / range * 100;
88
- scope.xPosition = Math.min(Math.max(0, scope.xPosition), 100);
91
+ scope.xPosition = bound(scope.xPosition, 0, 100);
89
92
  }
90
93
  if (scope.showValueInHandle) {
91
94
  return scope.handleValue = scope.value;
@@ -134,7 +137,7 @@
134
137
  if ((scope.min() <= newVal && newVal <= scope.max())) {
135
138
  return refreshHandle();
136
139
  } else {
137
- return newVal = oldVal;
140
+ return scope.value = bound(newVal, scope.min(), scope.max());
138
141
  }
139
142
  });
140
143
  scope.step = function(steps) {
@@ -255,3 +258,7 @@
255
258
  });
256
259
 
257
260
  }).call(this);
261
+
262
+ /*
263
+ //@ sourceMappingURL=glider.map
264
+ */
data/glider-rails.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "glider-rails"
7
- gem.version = "0.1.4.2"
7
+ gem.version = "0.1.4.3"
8
8
  gem.authors = ["Valentin Valve Vasilyev", "Dmitry KODer Karpunin"]
9
9
  gem.email = ["iamvalentin@gmail.com", "koderfunk@gmail.com"]
10
10
  gem.description = "Glider, AngularJS UI slider for rails asset pipeline"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glider-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4.2
4
+ version: 0.1.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-11-14 00:00:00.000000000 Z
13
+ date: 2013-11-25 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Glider, AngularJS UI slider for rails asset pipeline
16
16
  email: