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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b206fb730370ae40f1bbd1e53ea669756271626
|
4
|
+
data.tar.gz: 38e25f08ab07945ca5f5433799ee49f1d8c019d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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] << "
|
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\">
|
@@ -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('.
|
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', '.
|
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', '.
|
52
|
-
this.$element.on('mouseout.fu.spinbox', '.
|
53
|
-
this.$element.on('mousedown.fu.spinbox', '.
|
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', '.
|
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', '.
|
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
|
-
|
356
|
-
|
357
|
-
|
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
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
360
|
+
clearTimeout(this.mousewheelTimeout);
|
361
|
+
this.mousewheelTimeout = setTimeout(function () {
|
362
|
+
self.triggerChangedEvent();
|
363
|
+
}, 300);
|
363
364
|
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
365
|
+
if (delta < 0) {
|
366
|
+
this.step(true);
|
367
|
+
} else {
|
368
|
+
this.step(false);
|
369
|
+
}
|
369
370
|
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
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('.
|
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.
|
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-
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|