Using a more robust work-around for focus() on iOS
authorAlexander Ebert <ebert@woltlab.com>
Sun, 6 Dec 2015 14:06:58 +0000 (15:06 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 6 Dec 2015 14:07:06 +0000 (15:07 +0100)
wcfsetup/install/files/js/WCF.js

index e06760b6f82218843c60800e6d3fbec81d7df568..e5f0cd8d683fc74fb87e33e6aaf7c0e83dbb1681 100755 (executable)
@@ -184,8 +184,8 @@ window.shuffle = function(array) {
        
        // work-around for zoom bug on iOS when using .focus()
        if (jQuery.browser.iOS) {
-               jQuery.fn.focus = function() {
-                       return this;
+               jQuery.fn.focus = function(data, fn) {
+                       return arguments.length > 0 ? this.on('focus', null, data, fn) : this.trigger('focus');
                };
        }
 })(jQuery);