Skip to content

Commit

Permalink
Input date, the container property is only set, if there is something…
Browse files Browse the repository at this point in the history
… useful to set it to. Fixes #157
  • Loading branch information
erik-krogh committed Jun 17, 2016
1 parent c1a3987 commit 45b685c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ <h2 class="header">Input-date</h2>
name="created"
id="inputCreated"
ng-model="currentTime"
container="body"
container=""
format="dd/mm/yyyy"
months-full="{{ month }}"
months-short="{{ monthShort }}"
Expand Down Expand Up @@ -256,7 +256,7 @@ <h2 class="header">Input-date</h2>
name="created"
id="inputCreated"
ng-model="currentTime"
container="body"
container=""
format="dd/mm/yyyy"
months-full="{{ month }}"
months-short="{{ monthShort }}"
Expand Down
10 changes: 7 additions & 3 deletions src/angular-materialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@
$compile(element.contents())(scope);
if (!(scope.ngReadonly)) {
$timeout(function () {
var pickadateInput = element.pickadate({
container : (angular.isDefined(scope.container)) ? scope.container : 'body',
var options = {
container : scope.container,
format: (angular.isDefined(scope.format)) ? scope.format : undefined,
formatSubmit: (angular.isDefined(scope.formatSubmit)) ? scope.formatSubmit : undefined,
monthsFull: (angular.isDefined(monthsFull)) ? monthsFull : undefined,
Expand All @@ -676,7 +676,11 @@
onClose: (angular.isDefined(scope.onClose)) ? function(){ scope.onClose(); } : undefined,
onSet: (angular.isDefined(scope.onSet)) ? function(){ scope.onSet(); } : undefined,
onStop: (angular.isDefined(scope.onStop)) ? function(){ scope.onStop(); } : undefined
});
};
if (!scope.container) {
delete options.container;
}
var pickadateInput = element.pickadate(options);
//pickadate API
var picker = pickadateInput.pickadate('picker');

Expand Down

0 comments on commit 45b685c

Please sign in to comment.