From bf67fe8da4cbc21c0c8c842c29a08391ccb39e35 Mon Sep 17 00:00:00 2001 From: Alon Peretz Date: Sun, 10 Jul 2016 16:53:39 +0300 Subject: [PATCH 1/3] Bugfix: fixed TypeError when user data is not ready --- src/typeahead/typeahead.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index 6316225..ef5ff7b 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -104,7 +104,7 @@ angular.module('mm.foundation.typeahead', ['mm.foundation.position', 'mm.foundat //it might happen that several async queries were in progress if a user were typing fast //but we are interested only in responses that correspond to the current view value if (inputValue === modelCtrl.$viewValue && hasFocus) { - if (matches.length > 0) { + if (matches && matches.length > 0) { scope.activeIdx = 0; scope.matches.length = 0; @@ -304,7 +304,7 @@ angular.module('mm.foundation.typeahead', ['mm.foundation.position', 'mm.foundat scope.templateUrl = attrs.templateUrl; scope.isOpen = function () { - return scope.matches.length > 0; + return scope.matches && scope.matches.length > 0; }; scope.isActive = function (matchIdx) { From fa05f8518b5924a5c241f93da7ac47f6883ad316 Mon Sep 17 00:00:00 2001 From: Alon Peretz Date: Sun, 10 Jul 2016 16:54:00 +0300 Subject: [PATCH 2/3] Bugfix: fixed TypeError when user data is not ready --- .idea/angular-foundation.iml | 8 ++ .idea/misc.xml | 13 +++ .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 ++ .idea/workspace.xml | 188 +++++++++++++++++++++++++++++++++++ 5 files changed, 223 insertions(+) create mode 100644 .idea/angular-foundation.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/angular-foundation.iml b/.idea/angular-foundation.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/angular-foundation.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..72abef0 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..18b736c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..2445171 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1468157598411 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 9fd993405e260dda63d99d097bfc657050b2dba5 Mon Sep 17 00:00:00 2001 From: Alon Peretz Date: Sun, 10 Jul 2016 16:56:17 +0300 Subject: [PATCH 3/3] Revert "Bugfix: fixed TypeError when user data is not ready" This reverts commit fa05f8518b5924a5c241f93da7ac47f6883ad316. --- .idea/angular-foundation.iml | 8 -- .idea/misc.xml | 13 --- .idea/modules.xml | 8 -- .idea/vcs.xml | 6 -- .idea/workspace.xml | 188 ----------------------------------- 5 files changed, 223 deletions(-) delete mode 100644 .idea/angular-foundation.iml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/angular-foundation.iml b/.idea/angular-foundation.iml deleted file mode 100644 index c956989..0000000 --- a/.idea/angular-foundation.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 72abef0..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 18b736c..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 2445171..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - DEFINITION_ORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1468157598411 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file