Autoclose
Autoclose of the datepicker when selecting a value on the min-view would be very appreciated :+1:
I modified the dist/index.js so that when the data is entered into the model (ie: on the final view), the popup closes (using Jquery): Here's my diff:
--- client/js/index.js 2014-12-06 11:41:27.000000000 +1300
+++ /Users/nick/Downloads/angular-datepicker-master/dist/index.js 2014-11-25 03:59:18.000000000 +1300
@@ -215,12 +215,10 @@
scope.model.setFullYear(date.getFullYear());
}
scope.$emit('setDate', scope.model, scope.view);
- }
+ }
if (nextView) {
scope.setView(nextView);
- } else {
- $('.dropdown-toggle').parent().removeClass('open'); // Nick: This is where we should close the popup
}
};
+1 to that.
Alternatively to:
$('.dropdown-toggle').parent().removeClass('open');
If you don't want to point to a specific element, you can replace it with:
setTimeout(function(){ scope.$emit('$destroy'); }, 1);
Or (only when used with input fields):
$(':focus').blur();
I think this should be optional, like a flag on the date-picker directive like "<... auto-close='true' />"
I agree with @eralha. In mine opinion that's a big +1
Any plans for implementing that
I can implement that, i just need to give it a little more thinking, because you can manage the visibility of the datepicker with so many things for exp: ng-class, ng-visible etc... i need to see if the implementation doesn´t clash with any functionality
Yes, please add :+1:
Closed, you can set the attribute auto-close="true" to use this feature.