glider-rails 0.1.4 → 0.1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  ###
2
- glider 0.1.4 - AngularJS slider
2
+ glider 0.1.4.1 - 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.
@@ -141,7 +141,8 @@ gliderModule.directive 'slider', ['$document', ($document) ->
141
141
 
142
142
  scope.sliderClick = ($event) ->
143
143
  return if angular.element($event.target).hasClass('handle')
144
- scope.xPosition = $event.layerX / sliderElement.offsetWidth * 100
144
+ offsetX = $event.layerX ? $event.originalEvent?.layerX
145
+ scope.xPosition = offsetX / sliderElement.offsetWidth * 100
145
146
  scope.value = valueFromPosition()
146
147
  snap()
147
148
 
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 1.6.3
2
2
  /*
3
- glider 0.1.4 - AngularJS slider
3
+ glider 0.1.4.1 - 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.
@@ -177,10 +177,12 @@
177
177
  }
178
178
  };
179
179
  scope.sliderClick = function($event) {
180
+ var offsetX, _ref, _ref1;
180
181
  if (angular.element($event.target).hasClass('handle')) {
181
182
  return;
182
183
  }
183
- scope.xPosition = $event.layerX / sliderElement.offsetWidth * 100;
184
+ offsetX = (_ref = $event.layerX) != null ? _ref : (_ref1 = $event.originalEvent) != null ? _ref1.layerX : void 0;
185
+ scope.xPosition = offsetX / sliderElement.offsetWidth * 100;
184
186
  scope.value = valueFromPosition();
185
187
  return snap();
186
188
  };
@@ -6,5 +6,5 @@
6
6
  "src/glider.coffee"
7
7
  ],
8
8
  "names": [],
9
- "mappings": ";AAAA;;;;;;;;;;;;;;;;;;;;CAAA;CAAA;CAAA;CAAA,CAoBA,UApBA;CAAA,K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,GAAiB,IAAjB;CAAiC,CAAN,EAAA,CAAK,EAAL,QAAA;CAF3B,MAEgB;CAFhB,EAGW,EAAA,CAAX,EAAA,KAAW;CAHX,CAIuC,CAA5B,EAAA,CAAX,CAAW,CAAX,CAAW;CAJX,EAKS,GAAT,EAAS,KAAA;CACF,GAAP,EAAM,OAAN;CAR+B,IACjC;CADF,EAAmC;CAnLnC"
10
10
  }
@@ -1 +1 @@
1
- (function(){"use strict";var n;n=angular.module("glider",[]),n.directive("slider",["$document",function(n){return{template:'<span class="g-slider horizontal">\n <span class="slider" ng-click="sliderClick($event)">\n <span class="range" style="width: {{xPosition}}%;"></span>\n <span class="handle" style="left: {{xPosition}}%;" ng-mousedown="handleMouseDown($event)">\n <span class="value" ng-show="showValueInHandle">{{handleValue | intersperse}}</span>\n </span>\n </span>\n <span class="side dec">\n <span class="button" ng-click="step(-1)">-</span>\n <span class="bound-value">{{min() | intersperse}}</span>\n </span>\n <span class="side inc">\n <span class="button" ng-click="step(+1)">+</span>\n <span class="bound-value">{{max() | intersperse}}</span>\n </span>\n <span class="increments">\n <span ng-repeat="i in increments" class="i" style="left: {{i.offset}}%">\n {{ i.value | intersperse }}\n </span>\n </span>\n</span>',replace:!0,restrict:"E",scope:{value:"=",min:"&",max:"&"},link:function(e,a,s){var t,l,i,u,r,o,c,p,v;return i=function(){var n,a,t,l,i,u,r;if(null!=s.increments){for(t=e.min(),a=e.max(),l=100/Math.abs(a-t),e.increments=[],e.snapValues=[t,a],r=s.increments.split(","),i=0,u=r.length;u>i;i++)n=r[i],n=parseInt(n),n>t&&a>n&&(e.increments.push({value:n,offset:(n-t)*l}),e.snapValues.push(n));e.snapValues.sort(function(n,e){return n-e})}return void 0},r=a[0].getElementsByClassName("slider")[0],l=!1,e.xPosition=0,p=s.step||1,t=null!=s.deferUpdate,e.showValueInHandle=null!=s.showValueInHandle,null==e.value&&(e.value=e.min()),u=function(){var n;return n=e.max()-e.min(),0===n?e.xPosition=0:(e.xPosition=100*((e.value-e.min())/n),e.xPosition=Math.min(Math.max(0,e.xPosition),100)),e.showValueInHandle?e.handleValue=e.value:void 0},o=function(){var n,a,s,t,l,i,r;if(e.increments){for(s=1/0,r=e.snapValues,l=0,i=r.length;i>l;l++)t=r[l],a=Math.abs(t-e.value),s>a&&(s=a,n=t);e.value=n}return u()},v=function(){return Math.round(((e.max()-e.min())*(e.xPosition/100)+e.min())/p)*p},e.$watch("min()",function(n){return i(),e.value<n&&(e.value=n),o()}),e.$watch("max()",function(n){return i(),e.value>n&&(e.value=n),o()}),e.$watch("value",function(n,a){return l?void 0:e.min()<=n&&n<=e.max()?u():n=a}),e.step=function(n){var a,t;return t=function(n){var a;return a=e.value+n*p,e.min()<=a&&a<=e.max()?e.value=a:void 0},a=function(n){var a,s;return a=n>0?function(){var n,a,t,l;for(t=e.snapValues,l=[],n=0,a=t.length;a>n;n++)s=t[n],s>e.value&&l.push(s);return l}()[0]:function(){var n,a,t,l;for(t=e.snapValues,l=[],n=0,a=t.length;a>n;n++)s=t[n],s<e.value&&l.push(s);return l}().reverse()[0],null!=a?e.value=a:void 0},null!=s.increments?a(n):t(n)},e.sliderClick=function(n){return angular.element(n.target).hasClass("handle")?void 0:(e.xPosition=100*(n.layerX/r.offsetWidth),e.value=v(),o())},c=null,e.handleMouseDown=function(n){return angular.element(n.target).hasClass("handle")?(c=n.pageX,l=!0):void 0},n.on("mousemove",function(n){var a;if(l)return a=n.pageX-c,e.xPosition+=100*(a/r.offsetWidth),e.xPosition<0?e.xPosition=0:e.xPosition>100?e.xPosition=100:c=n.pageX,t||(e.value=v()),e.showValueInHandle&&(e.handleValue=v()),e.$apply()}),n.on("mouseup",function(){return l?(t&&(e.value=v()),o(),e.$apply(),l=!1):void 0})}}}]),n.filter("intersperse",function(){return function(n){var e,a,s;if(null!=n)return n=n.toString(),e=function(n){return n.split("").reverse().join("")},a=e(n),a=a.replace(/(.{3})/g,"$1 "),s=e(a),s.trim()}})}).call(this);
1
+ (function(){"use strict";var n;n=angular.module("glider",[]),n.directive("slider",["$document",function(n){return{template:'<span class="g-slider horizontal">\n <span class="slider" ng-click="sliderClick($event)">\n <span class="range" style="width: {{xPosition}}%;"></span>\n <span class="handle" style="left: {{xPosition}}%;" ng-mousedown="handleMouseDown($event)">\n <span class="value" ng-show="showValueInHandle">{{handleValue | intersperse}}</span>\n </span>\n </span>\n <span class="side dec">\n <span class="button" ng-click="step(-1)">-</span>\n <span class="bound-value">{{min() | intersperse}}</span>\n </span>\n <span class="side inc">\n <span class="button" ng-click="step(+1)">+</span>\n <span class="bound-value">{{max() | intersperse}}</span>\n </span>\n <span class="increments">\n <span ng-repeat="i in increments" class="i" style="left: {{i.offset}}%">\n {{ i.value | intersperse }}\n </span>\n </span>\n</span>',replace:!0,restrict:"E",scope:{value:"=",min:"&",max:"&"},link:function(e,a,s){var t,l,i,u,r,o,c,p,v;return i=function(){var n,a,t,l,i,u,r;if(null!=s.increments){for(t=e.min(),a=e.max(),l=100/Math.abs(a-t),e.increments=[],e.snapValues=[t,a],r=s.increments.split(","),i=0,u=r.length;u>i;i++)n=r[i],n=parseInt(n),n>t&&a>n&&(e.increments.push({value:n,offset:(n-t)*l}),e.snapValues.push(n));e.snapValues.sort(function(n,e){return n-e})}return void 0},r=a[0].getElementsByClassName("slider")[0],l=!1,e.xPosition=0,p=s.step||1,t=null!=s.deferUpdate,e.showValueInHandle=null!=s.showValueInHandle,null==e.value&&(e.value=e.min()),u=function(){var n;return n=e.max()-e.min(),0===n?e.xPosition=0:(e.xPosition=100*((e.value-e.min())/n),e.xPosition=Math.min(Math.max(0,e.xPosition),100)),e.showValueInHandle?e.handleValue=e.value:void 0},o=function(){var n,a,s,t,l,i,r;if(e.increments){for(s=1/0,r=e.snapValues,l=0,i=r.length;i>l;l++)t=r[l],a=Math.abs(t-e.value),s>a&&(s=a,n=t);e.value=n}return u()},v=function(){return Math.round(((e.max()-e.min())*(e.xPosition/100)+e.min())/p)*p},e.$watch("min()",function(n){return i(),e.value<n&&(e.value=n),o()}),e.$watch("max()",function(n){return i(),e.value>n&&(e.value=n),o()}),e.$watch("value",function(n,a){return l?void 0:e.min()<=n&&n<=e.max()?u():n=a}),e.step=function(n){var a,t;return t=function(n){var a;return a=e.value+n*p,e.min()<=a&&a<=e.max()?e.value=a:void 0},a=function(n){var a,s;return a=n>0?function(){var n,a,t,l;for(t=e.snapValues,l=[],n=0,a=t.length;a>n;n++)s=t[n],s>e.value&&l.push(s);return l}()[0]:function(){var n,a,t,l;for(t=e.snapValues,l=[],n=0,a=t.length;a>n;n++)s=t[n],s<e.value&&l.push(s);return l}().reverse()[0],null!=a?e.value=a:void 0},null!=s.increments?a(n):t(n)},e.sliderClick=function(n){var a,s,t;if(!angular.element(n.target).hasClass("handle"))return a=null!=(s=n.layerX)?s:null!=(t=n.originalEvent)?t.layerX:void 0,e.xPosition=100*(a/r.offsetWidth),e.value=v(),o()},c=null,e.handleMouseDown=function(n){return angular.element(n.target).hasClass("handle")?(c=n.pageX,l=!0):void 0},n.on("mousemove",function(n){var a;if(l)return a=n.pageX-c,e.xPosition+=100*(a/r.offsetWidth),e.xPosition<0?e.xPosition=0:e.xPosition>100?e.xPosition=100:c=n.pageX,t||(e.value=v()),e.showValueInHandle&&(e.handleValue=v()),e.$apply()}),n.on("mouseup",function(){return l?(t&&(e.value=v()),o(),e.$apply(),l=!1):void 0})}}}]),n.filter("intersperse",function(){return function(n){var e,a,s;if(null!=n)return n=n.toString(),e=function(n){return n.split("").reverse().join("")},a=e(n),a=a.replace(/(.{3})/g,"$1 "),s=e(a),s.trim()}})}).call(this);
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"
7
+ gem.version = "0.1.4.1"
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
4
+ version: 0.1.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: