caboose-cms 0.9.146 → 0.9.147

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: 7aff3ce4a08523756900e8de7cac6fe48a72baa4
4
- data.tar.gz: 8274f96e5f541177862d629963f7270dca1e75b9
3
+ metadata.gz: ef847981a36707a6f206d68625c1ecba615f4fea
4
+ data.tar.gz: 595cf0869f205fe9be52f39263e967627efb0e32
5
5
  SHA512:
6
- metadata.gz: b964fa02935fcdc278f30e2eb9803bf53a7c74f96f841f91c8db81a30c06bf2282d25c19b2410718761e650a89f681e7d5d739bd6c5eb47c3dcffb31f856c4eb
7
- data.tar.gz: 4d96562834d382ca40f5dc80039fb810096c027e9e7ca9011df47e9e01882a8529074af2fc1cf2369b9478c425a201191029861cc53ece6285ed49689468c60b
6
+ metadata.gz: 0384b1f2d91fa42758aadb374b3bd2031a46851a91a3dd80775988e439630e6dc281e1ea85fadc8a82b686e2ff5f0906c196bcd5713ad65e350933172996adc6
7
+ data.tar.gz: 3f51a5cbba1b436346db87f5c80beedac8cd8da56052fb325aba38dbb5c82668fb050cd369748ed808b3ad3e264d6ae8b2c407975d31081501993050847d27c5
@@ -10,6 +10,7 @@ BoundDateTime = BoundControl.extend({
10
10
  save_attempts: 0,
11
11
 
12
12
  init: function(params) {
13
+ var that = this;
13
14
  for (var thing in params)
14
15
  this[thing] = params[thing];
15
16
 
@@ -32,29 +33,39 @@ BoundDateTime = BoundControl.extend({
32
33
  if (this.attribute.fixed_placeholder)
33
34
  $('#'+this.el+'_container').append($('<div/>').attr('id', this.el + '_placeholder').addClass('mb_placeholder').append($('<span/>').html(this.attribute.nice_name + ': ')));
34
35
  if (this.attribute.width) $('#'+this.el).css('width' , this.attribute.width);
35
- if (this.attribute.fixed_placeholder)
36
- {
37
- var w = $('#'+this.el+'_placeholder').outerWidth();
38
- //$('#'+this.el).attr('placeholder', 'empty').css('padding-left', '+=' + w).css('width', '-=' + w);
39
- }
36
+ if (that.attribute.fixed_placeholder && that.attribute.align != 'right')
37
+ that.set_placeholder_padding();
40
38
 
41
- var this2 = this;
42
- $('#'+this.el).on('keyup', function(e) {
43
- if (e.keyCode == 27) this2.cancel(); // Escape
44
- if (e.keyCode == 13) this2.save(); // Enter
39
+ // var this2 = this;
40
+ // $('#'+this.el).on('keyup', function(e) {
41
+ // if (e.keyCode == 27) this2.cancel(); // Escape
42
+ // if (e.keyCode == 13) this2.save(); // Enter
45
43
 
46
- if ($('#'+this2.el).val() != this2.attribute.value_clean)
47
- $('#'+this2.el).addClass('mb_dirty');
44
+ // if ($('#'+this2.el).val() != this2.attribute.value_clean)
45
+ // $('#'+this2.el).addClass('mb_dirty');
46
+ // else
47
+ // $('#'+this2.el).removeClass('mb_dirty');
48
+ // });
49
+ // $('#'+this.el).on('blur', function() {
50
+ // if (this2.save_attempts < 1)
51
+ // {
52
+ // this2.save_attempts++;
53
+ // this2.save();
54
+ // }
55
+ // });
56
+
57
+ $('#'+that.el).on('keyup', function(e) {
58
+ if (e.keyCode == 27) that.cancel(); // Escape
59
+ if (e.keyCode == 13) that.save(); // Enter
60
+ if ($('#'+that.el).val() != that.attribute.value_clean)
61
+ $('#'+that.el).addClass('mb_dirty');
48
62
  else
49
- $('#'+this2.el).removeClass('mb_dirty');
63
+ $('#'+that.el).removeClass('mb_dirty');
50
64
  });
51
- $('#'+this.el).on('blur', function() {
52
- if (this2.save_attempts < 1)
53
- {
54
- this2.save_attempts++;
55
- this2.save();
56
- }
57
- });
65
+ $('#'+that.el).on('blur', function() { that.save(); });
66
+ $('#'+that.el).on('change', function() { that.save(); });
67
+
68
+
58
69
  $('#'+this.el).css('z-index', 21);
59
70
  $('#'+this.el).css('position', 'relative');
60
71
  $('#'+this.el).css('background', 'transparent');
@@ -64,6 +75,16 @@ BoundDateTime = BoundControl.extend({
64
75
  step: 15
65
76
  });
66
77
  },
78
+
79
+ set_placeholder_padding: function() {
80
+ var that = this;
81
+ var w = $('#'+that.el+'_placeholder').outerWidth() + 10;
82
+ if (w > 10)
83
+ $('#'+that.el).css('padding-left', w);
84
+ else {
85
+ setTimeout(function() { that.set_placeholder_padding(); }, 500);
86
+ }
87
+ },
67
88
 
68
89
  save: function() {
69
90
  this.attribute.value = $('#'+this.el).val();
@@ -55,8 +55,6 @@ BoundText = BoundControl.extend({
55
55
  $('#'+that.el).on('keyup', function(e) {
56
56
  if (e.keyCode == 27) that.cancel(); // Escape
57
57
  if (e.keyCode == 13) that.save(); // Enter
58
-
59
-
60
58
  if ($('#'+that.el).val() != that.attribute.value_clean)
61
59
  $('#'+that.el).addClass('mb_dirty');
62
60
  else
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.146'
2
+ VERSION = '0.9.147'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.146
4
+ version: 0.9.147
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-07 00:00:00.000000000 Z
11
+ date: 2018-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg