bootstrap-datepicker-rails 0.6.42 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module BootstrapDatepickerRails
2
2
  module Rails
3
- VERSION = "0.6.42"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
@@ -41,7 +41,7 @@
41
41
  this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||dates[this.language].format||'mm/dd/yyyy');
42
42
  this.isInline = false;
43
43
  this.isInput = this.element.is('input');
44
- this.component = this.element.is('.date') ? this.element.find('.add-on') : false;
44
+ this.component = this.element.is('.date') ? this.element.find('.add-on, .btn') : false;
45
45
  this.hasInput = this.component && this.element.find('input').length;
46
46
  if(this.component && this.component.length === 0)
47
47
  this.component = false;
@@ -138,6 +138,8 @@
138
138
  return parseInt(val) + 1;
139
139
  });
140
140
 
141
+ this._allow_update = false;
142
+
141
143
  this.weekStart = ((options.weekStart||this.element.data('date-weekstart')||dates[this.language].weekStart||0) % 7);
142
144
  this.weekEnd = ((this.weekStart + 6) % 7);
143
145
  this.startDate = -Infinity;
@@ -148,6 +150,9 @@
148
150
  this.setDaysOfWeekDisabled(options.daysOfWeekDisabled||this.element.data('date-days-of-week-disabled'));
149
151
  this.fillDow();
150
152
  this.fillMonths();
153
+
154
+ this._allow_update = true;
155
+
151
156
  this.update();
152
157
  this.showMode();
153
158
 
@@ -212,11 +217,9 @@
212
217
  show: function(e) {
213
218
  this.picker.show();
214
219
  this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
215
- this.update();
216
220
  this.place();
217
221
  $(window).on('resize', $.proxy(this.place, this));
218
- if (e ) {
219
- e.stopPropagation();
222
+ if (e) {
220
223
  e.preventDefault();
221
224
  }
222
225
  this.element.trigger({
@@ -339,7 +342,10 @@
339
342
  });
340
343
  },
341
344
 
345
+ _allow_update: true,
342
346
  update: function(){
347
+ if (!this._allow_update) return;
348
+
343
349
  var date, fromArgs = false;
344
350
  if(arguments && arguments.length && (typeof arguments[0] === 'string' || arguments[0] instanceof Date)) {
345
351
  date = arguments[0];
@@ -494,6 +500,8 @@
494
500
  },
495
501
 
496
502
  updateNavArrows: function() {
503
+ if (!this._allow_update) return;
504
+
497
505
  var d = new Date(this.viewDate),
498
506
  year = d.getUTCFullYear(),
499
507
  month = d.getUTCMonth();
@@ -527,7 +535,6 @@
527
535
  },
528
536
 
529
537
  click: function(e) {
530
- e.stopPropagation();
531
538
  e.preventDefault();
532
539
  var target = $(e.target).closest('span, td, th');
533
540
  if (target.length == 1) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-datepicker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.42
4
+ version: 1.0.0
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-02-18 00:00:00.000000000 Z
12
+ date: 2013-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -186,7 +186,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
186
  version: '0'
187
187
  segments:
188
188
  - 0
189
- hash: 2184944113623658522
189
+ hash: 1762768020851591761
190
190
  required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  none: false
192
192
  requirements:
@@ -195,10 +195,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  version: '0'
196
196
  segments:
197
197
  - 0
198
- hash: 2184944113623658522
198
+ hash: 1762768020851591761
199
199
  requirements: []
200
200
  rubyforge_project:
201
- rubygems_version: 1.8.24
201
+ rubygems_version: 1.8.25
202
202
  signing_key:
203
203
  specification_version: 3
204
204
  summary: A date picker for Twitter Bootstrap