Materialize timepicker option container now working.
$('.timepicker').pickatime({
container: '#div'
});
Is there any solution e.g. .appedTo('body') ?
The container option is not supported in Materialize. https://github.com/Dogfalo/materialize/blob/master/js/date_picker/picker.time.js
Oh sorry, thanks Daniel
Open picker.time.js
Add default container option
// Default options
ClockPicker.DEFAULTS = {
'default': '',
fromnow: 0,
donetext: 'Ok',
cleartext: 'Clear',
canceltext: 'Cancel',
autoclose: false,
ampmclickable: true,
darktheme: false,
twelvehour: true,
vibrate: true,
container: 'body' // container <--THIS IS ADDED
};
Then change this line
// Append popover to body
this.popover.insertAfter(this.input);
to this
// Append popover to body
this.popover.appendTo(this.options.container);
$('.timepicker').pickatime({
container: '#customdiv'
});
Just CTRL+F this lines for better search:
This for appendTo
this.isAppended||(this.popover
and this for defaults
n.DEFAULTS={default:"
Seems solved then
Hi guys! The solution of @rharasim works well.. but I'm using Meteor and there's no way to change compiled packages. There's a possibility in the future to add the container feature in timepicker? I need timepicker inside modals with appendTo('body').
Thanks in advance and congratulations for this package!
Thank you so much @rharasim, it was exactly what i needed
Hi guys! I tried the solution of @rharasim but it doesn't fix my problem!
Can you please add the "container:'body'" feature to timepicker?
Thanks
Just made a pull request with the fix from @rharasim, it works just fine.
Most helpful comment
Just made a pull request with the fix from @rharasim, it works just fine.