diff --git a/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 b/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 index cc93ebdd68d..f549bc39ccd 100644 --- a/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 +++ b/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 @@ -1,5 +1,4 @@ function applicable() { - // This will apply hack on all iDevices return navigator.userAgent.match(/(iPad|iPhone|iPod)/g) && navigator.userAgent.match(/Safari/g); @@ -15,7 +14,6 @@ function positioningWorkaround($fixedElement) { var done = false; var originalScrollTop = 0; - var wasDocked; var blurredNow = function(evt) { if (!done && _.include($(document.activeElement).parents(), fixedElement)) { @@ -27,17 +25,12 @@ function positioningWorkaround($fixedElement) { fixedElement.parentElement.style.height = ''; $('#main-outlet').show(); - $('header').show(); fixedElement.style.position = ''; fixedElement.style.top = ''; fixedElement.style.height = ''; $(window).scrollTop(originalScrollTop); - if (wasDocked) { - $('body').addClass('docked'); - } - if (evt) { evt.target.removeEventListener('blur', blurred); } @@ -63,12 +56,8 @@ function positioningWorkaround($fixedElement) { originalScrollTop = $(window).scrollTop(); - wasDocked = $('body').hasClass('docked'); - // take care of body $('#main-outlet').hide(); - $('header').hide(); - fixedElement.style.position = 'absolute'; // get out of the way while opening keyboard @@ -93,7 +82,7 @@ function positioningWorkaround($fixedElement) { } const checkForInputs = _.debounce(function(){ - $fixedElement.find('button,a:not(.autocomplete)').each(function(idx, elem){ + $fixedElement.find('button,a:not(.mobile-file-upload)').each(function(idx, elem){ if ($(elem).parents('.autocomplete').length > 0) { return; } @@ -105,7 +94,7 @@ function positioningWorkaround($fixedElement) { $(this).click(); }); }); - $fixedElement.find('input,textarea').each(function(){ + $fixedElement.find('input[type=text],textarea').each(function(){ attachTouchStart(this, positioningHack); }); }, 100); diff --git a/app/assets/javascripts/discourse/templates/composer.hbs b/app/assets/javascripts/discourse/templates/composer.hbs index 9bfcc61bc1a..64967312079 100644 --- a/app/assets/javascripts/discourse/templates/composer.hbs +++ b/app/assets/javascripts/discourse/templates/composer.hbs @@ -91,9 +91,7 @@