mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
Merge pull request #6182 from jgw96/2.0
chore(tsling): prevent nested function declaration
This commit is contained in:
@ -40,20 +40,22 @@ export class NativeInput {
|
||||
var self = this;
|
||||
|
||||
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');
|
||||
|
@ -80,6 +80,7 @@
|
||||
"systemjs": "0.19.6",
|
||||
"through2": "^0.6.3",
|
||||
"tslint": "^3.7.1",
|
||||
"tslint-eslint-rules": "^1.2.0",
|
||||
"typescript": "1.8.7",
|
||||
"vinyl": "^0.4.6",
|
||||
"webpack": "^1.12.2",
|
||||
@ -90,4 +91,4 @@
|
||||
"path": "node_modules/ionic-cz-conventional-changelog"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"rulesDirectory": "node_modules/tslint-eslint-rules/dist/rules",
|
||||
"rules": {
|
||||
"class-name": true,
|
||||
"comment-format": [
|
||||
@ -52,6 +53,10 @@
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type"
|
||||
],
|
||||
"no-inner-declarations": [
|
||||
true,
|
||||
"functions"
|
||||
]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user