From eed69ee5d59e9aec847a9f1065fe6954dbb2f87e Mon Sep 17 00:00:00 2001 From: pvblicltd Date: Tue, 21 Apr 2015 11:27:12 +0100 Subject: [PATCH] Readonly attribute adds the option e-readonly="true/false" - defaults to false to the date input (allowing to stop the user from editing the field and only using the datepicker) --- src/js/directives/bsdate.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/directives/bsdate.js b/src/js/directives/bsdate.js index f1e5455a..38599b3a 100644 --- a/src/js/directives/bsdate.js +++ b/src/js/directives/bsdate.js @@ -17,7 +17,8 @@ angular.module('xeditable').directive('editableBsdate', ['editableDirectiveFacto var inputDatePicker = angular.element(''); var buttonDatePicker = angular.element(''); var buttonWrapper = angular.element(''); - + + inputDatePicker.attr('ng-readonly', this.attrs.eReadonly || false); inputDatePicker.attr('datepicker-popup', this.attrs.eDatepickerPopupXEditable || 'yyyy/MM/dd' ); inputDatePicker.attr('is-open', this.attrs.eIsOpen); inputDatePicker.attr('date-disabled', this.attrs.eDateDisabled); @@ -56,4 +57,4 @@ angular.module('xeditable').directive('editableBsdate', ['editableDirectiveFacto } }); -}]); \ No newline at end of file +}]);