Skip to content

Commit

Permalink
#73 convey ng-disabled to buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
hexadecy committed Apr 6, 2020
1 parent 709fd98 commit fdbd70a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dist/angular-material-datetimepicker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/angular-material-datetimepicker.min.js.map

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions js/angular-material-datetimepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,17 @@
var calendarButton =
'<md-button class="dtp-btn-calendar md-icon-button" type="button"' +
'tabindex="-1" aria-hidden="true" ' +
(attrs.ngDisabled === "true" ? 'disabled ' : '') +
'ng-click="openCalendarDiag($event)">' +
'<md-icon aria-label="md-calendar" md-svg-src="' + (scope.date ? mdCalendar : mdAccesTime) + '"></md-icon>' +
'</md-button>',
clearButton = scope.showClear === undefined || scope.showClear ? '<md-button ng-show="currentDate" class="md-icon-button dtp-clear" aria-hidden="true" ng-click="clear()">&#x2715;</md-button>' : '';
'</md-button>', clearButton = '';

if (scope.showClear === undefined || scope.showClear) {
clearButton = '<md-button ' +
(attrs.ngDisabled === "true" ? 'disabled ' : '') +
'ng-show="currentDate" class="md-icon-button dtp-clear" aria-hidden="true" ng-click="clear()">&#x2715;</md-button>';
}

element.after($compile(calendarButton + clearButton)(scope));

scope.openCalendarDiag = function(e) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
},
"devDependencies": {
"gulp": "^4.0.2",
"gulp-clean-css": "^4.2.0",
"gulp-rename": "^1.4.0",
"gulp-clean-css": "^4.3.0",
"gulp-rename": "^2.0.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-uglify": "^3.0.2",
"lite-server": "^2.5.4",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6:
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02"
integrity sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==

gulp-clean-css@^4.2.0:
gulp-clean-css@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/gulp-clean-css/-/gulp-clean-css-4.3.0.tgz#5b1e73f2fca46703eb636014cdd4553cea65146d"
integrity sha512-mGyeT3qqFXTy61j0zOIciS4MkYziF2U594t2Vs9rUnpkEHqfu6aDITMp8xOvZcvdX61Uz3y1mVERRYmjzQF5fg==
Expand Down Expand Up @@ -1334,10 +1334,10 @@ gulp-cli@^2.2.0:
v8flags "^3.0.1"
yargs "^7.1.0"

gulp-rename@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/gulp-rename/-/gulp-rename-1.4.0.tgz#de1c718e7c4095ae861f7296ef4f3248648240bd"
integrity sha512-swzbIGb/arEoFK89tPY58vg3Ok1bw+d35PfUNwWqdo7KM4jkmuGA78JiDNqR+JeZFaeeHnRg9N7aihX3YPmsyg==
gulp-rename@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/gulp-rename/-/gulp-rename-2.0.0.tgz#9bbc3962b0c0f52fc67cd5eaff6c223ec5b9cf6c"
integrity sha512-97Vba4KBzbYmR5VBs9mWmK+HwIf5mj+/zioxfZhOKeXtx5ZjBk57KFlePf5nxq9QsTtFl0ejnHE3zTC9MHXqyQ==

gulp-sourcemaps@^2.6.5:
version "2.6.5"
Expand Down

0 comments on commit fdbd70a

Please sign in to comment.