Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions js/jquery.keyboard.extension-mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,21 @@ $.fn.addMobile = function(options){
base.mobile_setup();
}

// Setup mobile theme on keyboard once it is visible
base.$el.bind('visible.keyboard', function() {
// Setup mobile theme on keyboard once it is visible.
// Note: There is a 10ms delay after the keyboard is displayed before it actually fires 'visible.keyboard'.
// Since we are restyling here, the user will experience FlashOfUnstyledContent (FOUC).
// This is avoided by first setting the visibility to hidden, then after the mobile styles are applied we
// set it visible.
//
base.$el.on('beforeVisible.keyboard', function () {
if (base.mobile_initialized !== true) {
base.$keyboard.css("visibility", "hidden");
}
})
.on('visible.keyboard', function () {
if (base.mobile_initialized !== true) {
base.mobile_setup();
base.$keyboard.css("visibility", "visible");
}
});

Expand Down