combo_auto_box 0.0.22 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module ComboAutoBox
2
- VERSION = '0.0.22'
2
+ VERSION = '0.0.23'
3
3
  end
@@ -206,34 +206,42 @@ var ComboAutoBox = {
206
206
  };
207
207
 
208
208
  var adjustExpanderImage = function() {
209
- if (options.type != 'simple') {
210
- return false;
211
- }
212
-
213
- spanTag = $('#' + container + ' > div.container-combo-auto-box > span.simple');
209
+ if (options.type == 'simple') {
210
+ spanTag = $('#' + container + ' > div.container-combo-auto-box > span.simple');
214
211
 
215
- inputWidth = getTextFieldWidth(textField);
216
- inputHeight = getTextFieldHeight(textField);
212
+ inputWidth = getTextFieldWidth(textField);
213
+ inputHeight = getTextFieldHeight(textField);
217
214
 
218
- inputBorderTop = getTextFieldBorder(textField, 'top');
219
- inputBorderBottom = getTextFieldBorder(textField, 'bottom');
215
+ inputBorderTop = getTextFieldBorder(textField, 'top');
216
+ inputBorderBottom = getTextFieldBorder(textField, 'bottom');
220
217
 
221
- if (inputHeight % 2 != 0) {
222
- inputBorderTop = inputBorderTop + 2;
223
- }
218
+ if (inputHeight % 2 != 0) {
219
+ inputBorderTop = inputBorderTop + 2;
220
+ }
224
221
 
225
- iWidth = 20;
226
- if (inputWidth < 20) {
227
- iWidth = 10;
228
- }
222
+ iWidth = 20;
223
+ if (inputWidth < 20) {
224
+ iWidth = 10;
225
+ }
229
226
 
230
- spanTag.css('margin-top', inputBorderTop.toString() + 'px');
231
- spanTag.css('margin-left', (inputWidth - iWidth + 4).toString() + 'px');
227
+ spanTag.css('margin-top', inputBorderTop.toString() + 'px');
228
+ spanTag.css('margin-left', (inputWidth - iWidth + 4).toString() + 'px');
232
229
 
233
- spanTag.children(':first').css('width', iWidth.toString() + 'px');
234
- spanTag.children(':first').css('height', inputHeight.toString() + 'px');
230
+ spanTag.children(':first').css('width', iWidth.toString() + 'px');
231
+ spanTag.children(':first').css('height', inputHeight.toString() + 'px');
235
232
 
236
- return true;
233
+ return true;
234
+ } else if (options.type == 'multiple') {
235
+ inputTop = 0;
236
+ try {
237
+ inputTop = parseInt(textField.css('margin-top').replace(/px/, ''));
238
+ inputTop = inputTop + parseInt(textField.css('padding-top').replace(/px/, ''));
239
+ $('#' + container + ' > div.container-combo-auto-box > span.multiple').css('margin-top', ((textField.height() / 2) - ($('span.multiple').height() / 2) - inputTop).toString() + 'px');
240
+ } catch (error) {
241
+ }
242
+ } else {
243
+ return false;
244
+ }
237
245
  }
238
246
 
239
247
  var getTextFieldWidth = function (textField) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: combo_auto_box
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-10 00:00:00.000000000 Z
12
+ date: 2013-12-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec