jquery-datetimepicker-rails 2.2.2.0 → 2.2.3.0

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: 8e8fdc6e4aa30e5047e680d61072d5975a8c45bf
4
- data.tar.gz: 9a6b03874766a70161cf6dfc06f5e843481c4866
3
+ metadata.gz: 81b1b446f08fcd172ee11acf4dc20ca3c7593084
4
+ data.tar.gz: a52d33c26c4f904482921c4e4c6283a90f3484c6
5
5
  SHA512:
6
- metadata.gz: c194136e9202fcbb67a16ec04edcbc5d813cd033a776e96d97556cbb6375a832cb194676b10df18ea830beb3bb559b9dd6519e2cf0871289f4a5a2f72982cc65
7
- data.tar.gz: 428b8663e8b8e395743e56db784fe9e46e31d0c77754b3ad71587701e4b382fe36cabc56b291508eb1fbfb5f638c61da19199faf710340962ceca902003d168e
6
+ metadata.gz: be6486efe1004e0f433ecfc5b5c211d1a1a1f63e4437a444c8e2a9f3f86866c86901cf1edfc4dc65a0bc1859ac5ca9a95ca0787089b4c017cdc423d533957500
7
+ data.tar.gz: 2cb4e6e163b45c6b5e7f189c05a2677768438acf44f3dec0546fe5bb093ce3261e75bbb572090e67383ba3bc51c0b17507146e24c6dfb1d404489eae7d1bc0f9
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @preserve jQuery DateTimePicker plugin v2.2.2
2
+ * @preserve jQuery DateTimePicker plugin v2.2.3
3
3
  * @homepage http://xdsoft.net/jqplugins/datetimepicker/
4
4
  * (c) 2014, Chupurnov Valeriy.
5
5
  */
@@ -183,6 +183,8 @@
183
183
  scrollTime:true,
184
184
  scrollInput:true,
185
185
 
186
+ lazyInit:true,
187
+
186
188
  mask:false,
187
189
  validateOnBlur:true,
188
190
  allowBlank:true,
@@ -330,8 +332,32 @@
330
332
  YKEY = 89,
331
333
  ctrlDown = false,
332
334
  options = ($.isPlainObject(opt)||!opt)?$.extend(true,{},default_options,opt):$.extend({},default_options),
335
+
336
+ lazyInitTimer = 0,
337
+
338
+ lazyInit = function( input ){
339
+ input
340
+ .on('open.xdsoft focusin.xdsoft mousedown.xdsoft',function initOnActionCallback(event) {
341
+ if( input.is(':disabled')||input.is(':hidden')||!input.is(':visible')||input.data( 'xdsoft_datetimepicker') )
342
+ return;
343
+
344
+ clearTimeout(lazyInitTimer);
345
+
346
+ lazyInitTimer = setTimeout(function() {
347
+
348
+ if( !input.data( 'xdsoft_datetimepicker') )
349
+ createDateTimePicker(input);
350
+
351
+ input
352
+ .off('open.xdsoft focusin.xdsoft mousedown.xdsoft',initOnActionCallback)
353
+ .trigger('open.xdsoft');
354
+ },100);
355
+
356
+ });
357
+ },
333
358
 
334
359
  createDateTimePicker = function( input ) {
360
+
335
361
  var datetimepicker = $('<div '+(options.id?'id="'+options.id+'"':'')+' '+(options.style?'style="'+options.style+'"':'')+' class="xdsoft_datetimepicker xdsoft_noselect '+options.className+'"></div>'),
336
362
  xdsoft_copyright = $('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),
337
363
  datepicker = $('<div class="xdsoft_datepicker active"></div>'),
@@ -1194,7 +1220,12 @@
1194
1220
  }
1195
1221
  return 0;
1196
1222
  }else
1197
- ($.type(opt) !== 'string')&&createDateTimePicker($(this));
1223
+ if( ($.type(opt) !== 'string') ){
1224
+ if( !options.lazyInit||options.open||options.inline ){
1225
+ createDateTimePicker($(this));
1226
+ }else
1227
+ lazyInit($(this));
1228
+ }
1198
1229
  });
1199
1230
  };
1200
1231
  })( jQuery );
@@ -1,7 +1,7 @@
1
1
  module Jquery
2
2
  module Datetimepicker
3
3
  module Rails
4
- VERSION = '2.2.2.0'
4
+ VERSION = '2.2.3.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-datetimepicker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2.0
4
+ version: 2.2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Novikov