active_frontend 14.1.22 → 14.1.23

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: 41701093881d7c0de38f2b7d5e91123860ad5aa2
4
- data.tar.gz: 60bb118029c5a3df76737167f558fa17aa32375e
3
+ metadata.gz: aa1d31b89fe81f605ef3c54166bf7d4ee412dbc7
4
+ data.tar.gz: 924b893a9c628ac9310b18c6ccf280834d28d65d
5
5
  SHA512:
6
- metadata.gz: ed88e769e82dfc5303155962fd392fa67961fadc3bb22219290f1092af68c8e0072c0c4a468731ec8a2575463e4aa0d6d6edef091b8bb9100cb0f885cab456fc
7
- data.tar.gz: a2a0c5c67cf447af0dbebbfadca272b01e3beee9efc31732fd5429c98c70bf4ed973188b6184e2ffe70d7604e2f1071c432c7a8bd2371f0857db435a40fb4bd8
6
+ metadata.gz: a99340a12f32ddec41d0703cf002b4d6e484c80647028dfdc7eff27d35a3591c7f0f67337868e722c8bde3e25025809d0084c155471ef230afe927e324c0e3e8
7
+ data.tar.gz: 3c63e77f51648f2031a579b0b3c227c0c74694d4b06c3de852d8358a817aebca182b7822ba910af2d2bc25bdd777298869a82aadd61bee69cd5d468e1748270c
@@ -1,3 +1,3 @@
1
1
  module ActiveFrontend
2
- VERSION = '14.1.22'.freeze
2
+ VERSION = '14.1.23'.freeze
3
3
  end
@@ -11,12 +11,12 @@
11
11
  cancel: this.$element.data('btn-class-cancel') || Affirm.DEFAULTS.btnClass.cancel,
12
12
  confirm: this.$element.data('btn-class-confirm') || Affirm.DEFAULTS.btnClass.confirm
13
13
  },
14
- format: this.$element.data('format'),
14
+ format: this.$element.data('format') || Affirm.DEFAULTS.text.format,
15
15
  text: {
16
16
  cancel: this.$element.data('text-cancel') || Affirm.DEFAULTS.text.cancel,
17
17
  confirm: this.$element.data('text-confirm') || Affirm.DEFAULTS.text.confirm
18
18
  },
19
- title: this.$element.data('title')
19
+ title: this.$element.data('title') || Affirm.DEFAULTS.text.title
20
20
  };
21
21
  this.options = $.extend({}, Affirm.DEFAULTS, this.settings, options);
22
22
 
@@ -8,11 +8,11 @@
8
8
  this.$element = $(element);
9
9
 
10
10
  this.settings = {
11
- delay: this.$element.data('delay'),
12
- duration: this.$element.data('duration'),
13
- effect: this.$element.data('effect'),
14
- hide: this.$element.data('hide'),
15
- infinite: this.$element.data('infinite')
11
+ delay: this.$element.data('delay') || Animation.DEFAULTS.delay,
12
+ duration: this.$element.data('duration') || Animation.DEFAULTS.duration,
13
+ effect: this.$element.data('effect') || Animation.DEFAULTS.effect,
14
+ hide: this.$element.data('hide') || Animation.DEFAULTS.hide,
15
+ infinite: this.$element.data('infinite') || Animation.DEFAULTS.infinite
16
16
  };
17
17
  this.options = $.extend({}, Animation.DEFAULTS, this.settings, options);
18
18
 
@@ -7,8 +7,8 @@
7
7
  var Choicepicker = function (element, options) {
8
8
  this.$element = $(element);
9
9
  this.settings = {
10
- choices: this.$element.data('choices'),
11
- fuzzySearch: this.$element.data('fuzzySearch'),
10
+ choices: this.$element.data('choices') || Choicepicker.DEFAULTS.text.choices,
11
+ fuzzySearch: this.$element.data('fuzzy-search') || Choicepicker.DEFAULTS.text.fuzzySearch,
12
12
  text: {
13
13
  all: this.$element.data('text-all') || Choicepicker.DEFAULTS.text.all,
14
14
  choiceless: this.$element.data('text-choiceless') || Choicepicker.DEFAULTS.text.choiceless,
@@ -16,7 +16,7 @@
16
16
  placeholder: this.$element.data('text-placeholder') || Choicepicker.DEFAULTS.text.placeholder,
17
17
  selectAll: this.$element.data('text-select-all') || Choicepicker.DEFAULTS.text.selectAll
18
18
  },
19
- type: this.$element.data('type')
19
+ type: this.$element.data('type') || Choicepicker.DEFAULTS.text.type
20
20
  };
21
21
  this.options = $.extend({}, Choicepicker.DEFAULTS, this.settings, options);
22
22
 
@@ -8,11 +8,11 @@
8
8
  this.$element = $(element);
9
9
  this.$element.data('datepicker', this);
10
10
  this.settings = {
11
- endDate: this.$element.data('end-date'),
12
- forceParse: this.$element.data('force-parse'),
13
- format: this.$element.data('format'),
14
- multidate: this.$element.data('multidate'),
15
- startDate: this.$element.data('start-date')
11
+ endDate: this.$element.data('end-date') || Datepicker.DEFAULTS.endDate,
12
+ forceParse: this.$element.data('force-parse') || Datepicker.DEFAULTS.forceParse,
13
+ format: this.$element.data('format') || Datepicker.DEFAULTS.format,
14
+ multidate: this.$element.data('multidate') || Datepicker.DEFAULTS.multidate,
15
+ startDate: this.$element.data('start-date') || Datepicker.DEFAULTS.startDate
16
16
  };
17
17
  this.options = $.extend({}, Datepicker.DEFAULTS, this.settings, options);
18
18
 
@@ -8,17 +8,17 @@
8
8
  var Filepicker = function (element, options) {
9
9
  this.$element = $(element);
10
10
  this.settings = {
11
- badgeClass: this.$element.data('badge-class'),
12
- buttonBefore: this.$element.data('button-before'),
13
- buttonClass: this.$element.data('button-class'),
14
- buttonText: this.$element.data('button-text'),
15
- disabled: this.$element.data('disabled'),
16
- iconClass: this.$element.data('icon-class'),
17
- inputClass: this.$element.data('input-class'),
18
- inputPlaceholder: this.$element.data('input-placeholder'),
19
- showBadge: this.$element.data('show-badge'),
20
- showIcon: this.$element.data('show-icon'),
21
- showInput: this.$element.data('show-input')
11
+ badgeClass: this.$element.data('badge-class') || Filepicker.DEFAULTS.badgeClass,
12
+ buttonBefore: this.$element.data('button-before') || Filepicker.DEFAULTS.buttonBefore,
13
+ buttonClass: this.$element.data('button-class') || Filepicker.DEFAULTS.buttonClass,
14
+ buttonText: this.$element.data('button-text') || Filepicker.DEFAULTS.buttonText,
15
+ disabled: this.$element.data('disabled') || Filepicker.DEFAULTS.disabled,
16
+ iconClass: this.$element.data('icon-class') || Filepicker.DEFAULTS.iconClass,
17
+ inputClass: this.$element.data('input-class') || Filepicker.DEFAULTS.inputClass,
18
+ inputPlaceholder: this.$element.data('input-placeholder') || Filepicker.DEFAULTS.inputPlaceholder,
19
+ showBadge: this.$element.data('show-badge') || Filepicker.DEFAULTS.showBadge,
20
+ showIcon: this.$element.data('show-icon') || Filepicker.DEFAULTS.showIcon,
21
+ showInput: this.$element.data('show-input') || Filepicker.DEFAULTS.showInput
22
22
  };
23
23
  this.options = $.extend({}, Filepicker.DEFAULTS, this.settings, options);
24
24
 
@@ -8,9 +8,9 @@
8
8
  this.$element = $(element);
9
9
  this.$window = $(window);
10
10
  this.settings = {
11
- addClass: this.$element.data('add-class'),
12
- offset: this.$element.data('offset'),
13
- removeClass: this.$element.data('remove-class')
11
+ addClass: this.$element.data('add-class') || Header.DEFAULTS.addClass,
12
+ offset: this.$element.data('offset') || Header.DEFAULTS.offset,
13
+ removeClass: this.$element.data('remove-class') || Header.DEFAULTS.removeClass
14
14
  };
15
15
  this.options = $.extend({}, Header.DEFAULTS, this.settings, options);
16
16
 
@@ -7,8 +7,8 @@
7
7
  var Hoverdown = function (element, options) {
8
8
  this.$element = $(element);
9
9
  this.settings = {
10
- delay: this.$element.data('delay'),
11
- timeout: this.$element.data('timeout')
10
+ delay: this.$element.data('delay') || Hoverdown.DEFAULTS.delay,
11
+ timeout: this.$element.data('timeout') || Hoverdown.DEFAULTS.timeout
12
12
  };
13
13
  this.options = $.extend({}, Hoverdown.DEFAULTS, this.settings, options);
14
14
 
@@ -8,12 +8,15 @@
8
8
  this.$element = $(element);
9
9
  this.$window = $(window);
10
10
  this.settings = {
11
- direction: this.$element.data('direction'),
12
- effect: this.$element.data('effect'),
13
- target: this.$element.data('target')
11
+ autoDetect: this.$element.data('auto-detect') || Layout.DEFAULTS.autoDetect,
12
+ direction: this.$element.data('direction') || Layout.DEFAULTS.direction,
13
+ effect: this.$element.data('effect') || Layout.DEFAULTS.effect,
14
+ target: this.$element.data('target') || Layout.DEFAULTS.target
14
15
  };
15
16
  this.options = $.extend({}, Layout.DEFAULTS, this.settings, options);
16
17
 
18
+ this.$initialClass = $(this.options.target).attr('class');
19
+
17
20
  this.init();
18
21
  this.toggleViewport();
19
22
  };
@@ -22,6 +25,7 @@
22
25
 
23
26
  Layout.VERSION = '1.0.0';
24
27
  Layout.DEFAULTS = {
28
+ autoDetect: true,
25
29
  direction: 'left',
26
30
  effect: 'slide',
27
31
  onToggleCallback: function (toggle) {},
@@ -57,18 +61,28 @@
57
61
 
58
62
  Layout.prototype.togglePosition = function (klass) {
59
63
  var target = $(this.options.target);
64
+ var isMobile = this.$window.width() < 767;
60
65
 
61
- if (this.$window.width() < 767) {
62
- target.addClass(klass);
66
+ if (this.options.autoDetect === true) {
67
+ if (isMobile) {
68
+ target.addClass(klass);
69
+ } else {
70
+ target.removeClass(klass);
71
+ }
63
72
  } else {
64
- target.removeClass(klass);
73
+ if (isMobile) {
74
+ target.addClass(klass);
75
+ } else {
76
+ target.removeClass(klass)
77
+ .addClass(this.$initialClass);
78
+ }
65
79
  }
66
80
  };
67
81
 
68
82
  Layout.prototype.toggleViewport = function () {
69
83
  var _self = this;
70
84
 
71
- this.togglePosition('hidden fixed');
85
+ if (this.options.autoDetect === true) this.togglePosition('hidden fixed');
72
86
 
73
87
  this.$window.on('resize.bs.layout orientationChange.bs.layout', function () {
74
88
  _self.togglePosition('hidden fixed');
@@ -7,8 +7,8 @@
7
7
  var List = function (element, options) {
8
8
  this.$element = $(element);
9
9
  this.settings = {
10
- input: this.$element.data('input'),
11
- emptyText: this.$element.data('empty-text')
10
+ emptyText: this.$element.data('empty-text') || List.DEFAULTS.emptyText,
11
+ input: this.$element.data('input') || List.DEFAULTS.input
12
12
  };
13
13
  this.options = $.extend({}, List.DEFAULTS, this.settings, options);
14
14
 
@@ -7,10 +7,10 @@
7
7
  var Selectpicker = function (element, options) {
8
8
  this.$element = $(element);
9
9
  this.settings = {
10
- fuzzySearch: this.$element.data('fuzzy-search'),
11
- includePrompt: this.$element.data('include-prompt'),
12
- optionHoverClass: this.$element.data('option-hover-class'),
13
- optionSelectedClass: this.$element.data('option-selected-class'),
10
+ fuzzySearch: this.$element.data('fuzzy-search') || Selectpicker.DEFAULTS.fuzzySearch,
11
+ includePrompt: this.$element.data('include-prompt') || Selectpicker.DEFAULTS.includePrompt,
12
+ optionHoverClass: this.$element.data('option-hover-class') || Selectpicker.DEFAULTS.optionHoverClass,
13
+ optionSelectedClass: this.$element.data('option-selected-class') || Selectpicker.DEFAULTS.optionSelectedClass,
14
14
  text: {
15
15
  selectless: this.$element.data('text-selectless') || Selectpicker.DEFAULTS.text.selectless,
16
16
  placeholder: this.$element.data('text-placeholder') || Selectpicker.DEFAULTS.text.placeholder,
@@ -7,9 +7,9 @@
7
7
  var Switch = function (element, options) {
8
8
  this.$element = $(element);
9
9
  this.settings = {
10
- baseClass: this.$element.data('base-class'),
11
- offClass: this.$element.data('off-class'),
12
- onClass: this.$element.data('on-class'),
10
+ baseClass: this.$element.data('base-class') || Switch.DEFAULTS.baseClass,
11
+ offClass: this.$element.data('off-class') || Switch.DEFAULTS.offClass,
12
+ onClass: this.$element.data('on-class') || Switch.DEFAULTS.onClass,
13
13
  text: {
14
14
  off: this.$element.data('text-off') || Switch.DEFAULTS.text.off,
15
15
  on: this.$element.data('text-on') || Switch.DEFAULTS.text.on
@@ -7,8 +7,8 @@
7
7
  var Timezone = function (element, options) {
8
8
  this.$element = $(element);
9
9
  this.settings = {
10
- default: this.$element.data('default'),
11
- format: this.$element.data('format')
10
+ default: this.$element.data('default') || Timezone.DEFAULTS.default,
11
+ format: this.$element.data('format') || Timezone.DEFAULTS.format
12
12
  };
13
13
  this.options = $.extend({}, Timezone.DEFAULTS, this.settings, options);
14
14
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.1.22
4
+ version: 14.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-24 00:00:00.000000000 Z
11
+ date: 2017-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails