-
Notifications
You must be signed in to change notification settings - Fork 101
Added option to use tel type for time fields #72
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,8 @@ angular.module("ion-datetime-picker", ["ionic"]) | |
hourStep: "=?", | ||
minuteStep: "=?", | ||
secondStep: "=?", | ||
onlyValid: "=?" | ||
onlyValid: "=?", | ||
telTypeForTimeFields: "=?" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this line (because all boolean attrs are handled differently, see below). |
||
}, | ||
controller: function($scope, $ionicPopup, $ionicPickerI18n, $timeout) { | ||
$scope.i18n = $ionicPickerI18n; | ||
|
@@ -281,6 +282,10 @@ angular.module("ion-datetime-picker", ["ionic"]) | |
changeViewData(); | ||
}; | ||
|
||
$scope.timeFieldType = function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this and instead use the same approach as for example $scope.timeFieldType = "useTelType" in $attrs && $attrs.useTelType !== "false" ? "tel" : "text";
|
||
return $scope.telTypeForTimeFields ? "tel" : "text"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the future, please try to maintain the existing code style, including indentation style, even if you think that it's weird and unusual :) |
||
}; | ||
|
||
if ($scope.dateEnabled) { | ||
$scope.$watch(function() { | ||
return new Date().getDate(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use
ng-attr-type=
instead oftype=
, there were some problems in older browsers with it.