Skip to content

Commit

Permalink
Merge branch '1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
acrobat committed Mar 22, 2015
2 parents e28f031 + 8add003 commit 97fefb8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/bootstrap-datepicker.js
Expand Up @@ -1089,6 +1089,9 @@
this._trigger('changeMonth', this.viewDate);
if (this.o.minViewMode === 1){
this._setDate(UTCDate(year, month, day));
this.showMode();
} else {
this.showMode(-1);
}
}
else {
Expand All @@ -1100,8 +1103,8 @@
if (this.o.minViewMode === 2){
this._setDate(UTCDate(year, month, day));
}
this.showMode(-1);
}
this.showMode(-1);
this.fill();
}
break;
Expand Down
34 changes: 34 additions & 0 deletions tests/suites/options.js
Expand Up @@ -960,3 +960,37 @@ test('Enable on readonly options (false)', function(){
input.focus();
ok(!picker.is(':visible'));
});

/*
*/

test('Startview: year view visible after date pick', function(){
var input = $('<input />')
.appendTo('#qunit-fixture')
.datepicker({
startView: 2,
minViewMode: 1,
autoclose: true
}),
dp = input.data('datepicker'),
picker = dp.picker,
target;

input.focus();
ok(picker.find('.datepicker-days').is(':not(:visible)'), 'Days view hidden');
ok(picker.find('.datepicker-months').is(':not(:visible)'), 'Months view hidden');
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');

target = picker.find('.datepicker-years tbody td:nth(7)');
target.click();
target = picker.find('.datepicker-years tbody td:nth(4)');
target.click();
target = picker.find('.datepicker-years tbody td:nth(20)');
target.click();

input.focus();
ok(picker.find('.datepicker-days').is(':not(:visible)'), 'Days view hidden');
ok(picker.find('.datepicker-months').is(':not(:visible)'), 'Months view hidden');
ok(picker.find('.datepicker-years').is(':visible'), 'Years view visible');
});

0 comments on commit 97fefb8

Please sign in to comment.