fix(input): move nested function outside of if statment so as to fix issue related to strict mode

There was a white screen issue caused on ios because of a nested function declaration in the input
component. I moved this function out of the if statement so as to fix this issue.

closes issue 187 on conference app repo
This commit is contained in:
Justin Willis
2016-04-15 14:14:47 -05:00
parent fcfd9fe9d4
commit c8e58e58a0

View File

@ -41,19 +41,21 @@ export class NativeInput {
self.focusChange.emit(true);
function docTouchEnd(ev) {
var tappedElement: any = ev.target;
if (tappedElement && self.element()) {
if (tappedElement.tagName !== "INPUT" && tappedElement.tagName !== "TEXTAREA") {
self.element().blur();
}
}
}
if (self._blurring) {
// automatically blur input if:
// 1) this input has focus
// 2) the newly tapped document element is not an input
console.debug('input blurring enabled');
function docTouchEnd(ev) {
var tappedElement: any = ev.target;
if (tappedElement && self.element()) {
if (tappedElement.tagName !== 'INPUT' && tappedElement.tagName !== 'TEXTAREA') {
self.element().blur();
}
}
}
document.addEventListener('touchend', docTouchEnd, true);
self._unrefBlur = function() {
console.debug('input blurring disabled');