simple_form_extension 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6bd9f5143cb4292539dbe72ea07c9e8b34dc3baf
4
- data.tar.gz: 9723e55b3a8233285cf23da9d90a997a22a03801
3
+ metadata.gz: 5b206fb730370ae40f1bbd1e53ea669756271626
4
+ data.tar.gz: 38e25f08ab07945ca5f5433799ee49f1d8c019d5
5
5
  SHA512:
6
- metadata.gz: fe14c41ed1884c7304268812adcf424b934fa81237a680693dd0d39e5dc7cd42102d7e38ea26ae6174577e7e4474acd4797cc07aa4059a7d0ffe0074e2399f11
7
- data.tar.gz: 0df975c6859ae09ad103ed819af12aaf9fdf3d0d8e4e4d6601a46704e7249705d59ad07d9cd32dc7e79fccb8deadac8b4a7026cb979a400700d2f3db15ea8d04
6
+ metadata.gz: b5c90dd4bd1990bcc84946a0b339d4cdf3a511027948f68fe12269e2bcac81a0f19b7dfeef8c1d305485da658306db34a78393d58b65618137402becb4f6e10b
7
+ data.tar.gz: 6557012e1af2945ca9f2f426671c7cb0271b19f2e5b5f515602a1e171ab8fa89f2379552885b5b42581b786f969d6bc3d0d7abd746ae908949257e2751c4fbff
@@ -2,9 +2,9 @@ module SimpleFormExtension
2
2
  module Inputs
3
3
  class NumericInput < SimpleForm::Inputs::Base
4
4
  def input(wrapper_options = nil)
5
- input_html_options[:class] << "spinner-input form-control"
5
+ input_html_options[:class] << "form-control spinbox-input"
6
6
  if options.fetch(:spinner, true)
7
- "<div class=\"input-group spinner\">
7
+ "<div class=\"input-group spinner-box-input\">
8
8
  #{@builder.text_field(attribute_name, input_html_options)}
9
9
  <span class=\"input-group-btn\">
10
10
  <span class=\"spinner-buttons btn-group-vertical\">
@@ -1,3 +1,3 @@
1
1
  module SimpleFormExtension
2
- VERSION = "1.1.5"
2
+ VERSION = "1.1.6"
3
3
  end
@@ -2,10 +2,11 @@ class Spinbox
2
2
  constructor: (@$el) ->
3
3
  @el = @$el[0]
4
4
 
5
- @$el.spinbox()
6
-
5
+ @$el.spinbox(max: Number.POSITIVE_INFINITY)
6
+
7
+
7
8
  onPageReady ->
8
- $spinbox = $('.spinner')
9
+ $spinbox = $('.spinner-box-input')
9
10
 
10
11
  return unless $spinbox.length
11
12
 
@@ -35,7 +35,7 @@
35
35
  e.preventDefault();
36
36
  });
37
37
  this.options = $.extend({}, $.fn.spinbox.defaults, options);
38
- this.$input = this.$element.find('.spinner-input');
38
+ this.$input = this.$element.find('.spinbox-input');
39
39
  this.$element.on('focusin.fu.spinbox', this.$input, $.proxy(this.changeFlag, this));
40
40
  this.$element.on('focusout.fu.spinbox', this.$input, $.proxy(this.change, this));
41
41
  this.$element.on('keydown.fu.spinbox', this.$input, $.proxy(this.keydown, this));
@@ -45,19 +45,19 @@
45
45
  this.mousewheelTimeout = {};
46
46
 
47
47
  if (this.options.hold) {
48
- this.$element.on('mousedown.fu.spinbox', '.spinner-up', $.proxy(function() {
48
+ this.$element.on('mousedown.fu.spinbox', '.spinbox-up', $.proxy(function() {
49
49
  this.startSpin(true);
50
50
  }, this));
51
- this.$element.on('mouseup.fu.spinbox', '.spinner-up, .spinner-down', $.proxy(this.stopSpin, this));
52
- this.$element.on('mouseout.fu.spinbox', '.spinner-up, .spinner-down', $.proxy(this.stopSpin, this));
53
- this.$element.on('mousedown.fu.spinbox', '.spinner-down', $.proxy(function() {
51
+ this.$element.on('mouseup.fu.spinbox', '.spinbox-up, .spinbox-down', $.proxy(this.stopSpin, this));
52
+ this.$element.on('mouseout.fu.spinbox', '.spinbox-up, .spinbox-down', $.proxy(this.stopSpin, this));
53
+ this.$element.on('mousedown.fu.spinbox', '.spinbox-down', $.proxy(function() {
54
54
  this.startSpin(false);
55
55
  }, this));
56
56
  } else {
57
- this.$element.on('click.fu.spinbox', '.spinner-up', $.proxy(function() {
57
+ this.$element.on('click.fu.spinbox', '.spinbox-up', $.proxy(function() {
58
58
  this.step(true);
59
59
  }, this));
60
- this.$element.on('click.fu.spinbox', '.spinner-down', $.proxy(function() {
60
+ this.$element.on('click.fu.spinbox', '.spinbox-down', $.proxy(function() {
61
61
  this.step(false);
62
62
  }, this));
63
63
  }
@@ -352,27 +352,29 @@
352
352
  },
353
353
 
354
354
  mousewheelHandler: function(event) {
355
- var e = window.event || event; // old IE support
356
- var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
357
- var self = this;
355
+ if (!this.options.disabled) {
356
+ var e = window.event || event; // old IE support
357
+ var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
358
+ var self = this;
358
359
 
359
- clearTimeout(this.mousewheelTimeout);
360
- this.mousewheelTimeout = setTimeout(function() {
361
- self.triggerChangedEvent();
362
- }, 300);
360
+ clearTimeout(this.mousewheelTimeout);
361
+ this.mousewheelTimeout = setTimeout(function () {
362
+ self.triggerChangedEvent();
363
+ }, 300);
363
364
 
364
- if (delta < 0) {
365
- this.step(true);
366
- } else {
367
- this.step(false);
368
- }
365
+ if (delta < 0) {
366
+ this.step(true);
367
+ } else {
368
+ this.step(false);
369
+ }
369
370
 
370
- if (e.preventDefault) {
371
- e.preventDefault();
372
- } else {
373
- e.returnValue = false;
371
+ if (e.preventDefault) {
372
+ e.preventDefault();
373
+ } else {
374
+ e.returnValue = false;
375
+ }
376
+ return false;
374
377
  }
375
- return false;
376
378
  }
377
379
  };
378
380
 
@@ -424,7 +426,7 @@
424
426
  // DATA-API
425
427
 
426
428
  $(document).on('mousedown.fu.spinbox.data-api', '[data-initialize=spinbox]', function(e) {
427
- var $control = $(e.target).closest('.spinner');
429
+ var $control = $(e.target).closest('.spinbox');
428
430
  if (!$control.data('fu.spinbox')) {
429
431
  $control.spinbox($control.data());
430
432
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Vasseur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-16 00:00:00.000000000 Z
11
+ date: 2015-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails