fe 2.1.2 → 2.1.4

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
  SHA256:
3
- metadata.gz: a12e14ff5fa1b0cf7c6c2ac0264a03b3e95a8f05dceb01bf42e0963ecb1436c4
4
- data.tar.gz: a6d9669f7a71e364d1c114d7db3f5b515762beae8fd08ee8b3b73391c898d328
3
+ metadata.gz: c2c44e123b4011acc1a3bcec88de8e57c444b3bb29bdae0726b28ffce191535d
4
+ data.tar.gz: bb4223a3158cf7c0f71865c26d9ace3e8c1017342dc25443f04e15eaa6b3a874
5
5
  SHA512:
6
- metadata.gz: bc9e85eebb802c6085cd771e0eefcf23c2f34c6b7a26ecdae14751a32894d51cafe911ffbfce8a071fc989837b3e92a9659c1a64370220d86786a04b23855797
7
- data.tar.gz: eadf4560863b3005841c19fc7b60b826b12b9b7a5d8f6e3503a4ae660b2fc48cc3dedadf8c341c39a46cefda15f0f99bf693b681f71699b2c2f06fc9410d18a7
6
+ metadata.gz: 7a1a1e827a8e35c8136e76b0831d611d0e680d6bd9ce2570b8559ba3b1ea00b4abc772bff3426b2a7d9f4606997ef99c506dcdab4f739ca24390465910e8bc66
7
+ data.tar.gz: 3eb967c51430ae55cb2ad680f41157b3aadc2a5c51ade7cf1678c14731d9b1500b9272c19e445db48b204fb9b19d8a4e7f1dc787f871f5e92f086a1b41e8fc18
@@ -1,40 +1,40 @@
1
1
  function setUpSortables() {
2
- $('[data-sortable]').sortable({axis:'y',
3
- items: '> li.sortable',
4
- dropOnEmpty:false,
5
- update: function(event, ui) {
6
- let sortable = this;
7
- $.ajax({data:$(this).sortable('serialize',{key:sortable.id + '[]'}),
8
- complete: function(request) {$(sortable).effect('highlight')},
9
- success:function(request){$('#errors').html(request)},
10
- type:'POST',
11
- url: $(sortable).attr('data-sortable-url')
12
- })
13
- },
14
- stop: function(event, ui) {
15
- let before_dropper = $('li.before-container[data-element_id="'+ui.item.data('element_id'));
16
- if (before_dropper.length > 0) {
17
- before_dropper.detach();
18
- before_dropper.insertBefore(ui.item);
19
- }
20
- let after_dropper = $('li.after-container[data-element_id="'+ui.item.data('element_id'));
21
- if (after_dropper.length > 0) {
22
- after_dropper.detach();
23
- after_dropper.insertAfter(ui.item);
24
- }
2
+ $('[data-sortable]').sortable({axis:'y',
3
+ items: '> li.sortable',
4
+ dropOnEmpty:false,
5
+ update: function(event, ui) {
6
+ let sortable = this;
7
+ $.ajax({data:$(this).sortable('serialize',{key:sortable.id + '[]'}),
8
+ complete: function(request) {$(sortable).effect('highlight')},
9
+ success:function(request){$('#errors').html(request)},
10
+ type:'POST',
11
+ url: $(sortable).attr('data-sortable-url')
12
+ })
13
+ },
14
+ stop: function(event, ui) {
15
+ let before_dropper = $('li.before-container[data-element_id="'+ui.item.data('element_id'));
16
+ if (before_dropper.length > 0) {
17
+ before_dropper.detach();
18
+ before_dropper.insertBefore(ui.item);
25
19
  }
26
- });
27
- $('[data-sortable][data-sortable-handle]').each(function() {
28
- handle = $(this).attr('data-sortable-handle');
29
- $(this).sortable("option", "handle", handle);
30
- });
20
+ let after_dropper = $('li.after-container[data-element_id="'+ui.item.data('element_id'));
21
+ if (after_dropper.length > 0) {
22
+ after_dropper.detach();
23
+ after_dropper.insertAfter(ui.item);
24
+ }
25
+ }
26
+ });
27
+ $('[data-sortable][data-sortable-handle]').each(function() {
28
+ handle = $(this).attr('data-sortable-handle');
29
+ $(this).sortable("option", "handle", handle);
30
+ });
31
31
 
32
- $('.droppable').droppable({
33
- activeClass: 'droppable-active',
32
+ $('.droppable').droppable({
33
+ activeClass: 'droppable-active',
34
34
  hoverClass: 'droppable-hover',
35
- drop: function( event, ui ) {
36
- $.post($(this).attr('data-url'), {draggable_element: ui.draggable.attr('id')}, function() {}, 'script')
37
- },
35
+ drop: function( event, ui ) {
36
+ $.post($(this).attr('data-url'), {draggable_element: ui.draggable.attr('id')}, function() {}, 'script')
37
+ },
38
38
  activate: function( event, ui ) {
39
39
  $draggable = ui.draggable;
40
40
  $container = $draggable.parents("li.element.container")
@@ -53,7 +53,7 @@ function setUpSortables() {
53
53
  $('li.around-container').removeClass('droppable-active');
54
54
  }
55
55
  }
56
- });
56
+ });
57
57
  }
58
58
 
59
59
  function setUpCalendars() {
@@ -67,27 +67,27 @@ function setUpCalendars() {
67
67
  }
68
68
 
69
69
  function setUpJsHelpers() {
70
- // ==================
71
- // Sortable
72
- setUpSortables();
73
- // ==================
70
+ // ==================
71
+ // Sortable
72
+ setUpSortables();
73
+ // ==================
74
74
 
75
- // ==================
76
- // Calendar
77
- setUpCalendars();
78
- // ==================
79
- <% unless Fe.bootstrap %>$(".tip[title], a[title]").tooltip()<% end %>
75
+ // ==================
76
+ // Calendar
77
+ setUpCalendars();
78
+ // ==================
79
+ <% unless Fe.bootstrap %>$(".tip[title], a[title]").tooltip()<% end %>
80
80
  }
81
81
 
82
82
  function fixGridColumnWidths() {
83
- $("table.grid").each(function(i, grid) {
83
+ $("table.grid").each(function(i, grid) {
84
84
  let num_columns = $(grid).find("th").length;
85
- if (num_columns > 0) {
85
+ if (num_columns > 0) {
86
86
  let width = (100 / num_columns) + "%";
87
- $(grid).find("> tbody > tr > th").css("width", width);
88
- $(grid).find("> tbody > tr > td").css("width", width);
89
- }
90
- });
87
+ $(grid).find("> tbody > tr > th").css("width", width);
88
+ $(grid).find("> tbody > tr > td").css("width", width);
89
+ }
90
+ });
91
91
  };
92
92
 
93
93
  function scrollTo(el) {
@@ -96,3 +96,11 @@ function scrollTo(el) {
96
96
  scrollTop: $(el).offset().top
97
97
  }, 1000);
98
98
  }
99
+
100
+ // jQuery 3 has removed $(document).on('ready', ...) in favor of $(document).ready(...). Manually call it from
101
+ // the new method here, so we can avoid changing over all the document ready's.
102
+ $(document).ready(function() {
103
+ if (typeof jQuery == 'function' && parseInt(jQuery.fn.jquery.split(".")[0]) >= 3) {
104
+ $(document).trigger("ready")
105
+ }
106
+ });
@@ -10,7 +10,7 @@
10
10
  return file.size || file.fileSize;
11
11
  }
12
12
  let available_events = ['onStart', 'onStartOne', 'onProgress', 'onFinishOne', 'onFinish', 'onError'];
13
- let options = $.extend({
13
+ options = $.extend({
14
14
  onStart: function(event, total) {
15
15
  return true;
16
16
  },
@@ -87,7 +87,7 @@ module Fe
87
87
  # NOTE: current_person is passed in for the benefit of enclosing apps that override locked?
88
88
  # and need to lock an element depending on who the current person is
89
89
  def locked?(params, answer_sheet, presenter, current_person)
90
- return true unless params['action'] == 'edit'
90
+ return true if params['action'] == 'show'
91
91
  if self.object_name == 'person.current_address' && ['address1','address2','city','zip','email','state','country'].include?(self.attribute_name)
92
92
  # Billing Address
93
93
  return false
data/lib/fe/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fe
2
- VERSION = "2.1.2"
2
+ VERSION = "2.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fe
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - CruGlobal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-22 00:00:00.000000000 Z
11
+ date: 2024-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails