[Building Sakai] Sakai DateTime Picker
Bryan Holladay
holladay at longsight.com
Mon Jul 28 18:33:33 PDT 2014
I had an instructor come up to me today and ask why she couldn't just type
in the dates when changing the open/close dates in her newly imported
assignments (it was annoying to her to have to click "next month" 12 times
instead of just updating the year). I wasn't expecting the datetime picker
to work this way, but it does and does so apparently for mobile devices. I
understand why you wouldn't want to show the keyboard on a mobile device,
but I don't know why you'd want to disable keyboard inputs for non mobile
computers. Is there a simple way for the JS file to know whether the
device is mobile or not already inside Sakai's JS API? The SO solution is
just a long REGEX check:
http://stackoverflow.com/questions/11381673/javascript-solution-to-detect-mobile-browser.
I think we should not have the input disabled by default unless proven to
be a mobile device. Thoughts?
Here is the datetime picker JS code:
https://source.sakaiproject.org/svn/reference/trunk/library/src/webapp/js/lang-datepicker/lang-datepicker.js
// disable the input field on show as to not display a tablet keyboard
cfg.onClose = function(dateText, inst) {
$(this).removeProp("disabled");
};
// re-enables input field
cfg.beforeShow = function(input, inst) {
$(this).prop("disabled", 'disabled');
};
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140728/75d535fe/attachment.html
More information about the sakai-dev
mailing list