ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [09/11] ignite git commit: Don't show placeholder for false, 0 value.
Date Wed, 13 Jul 2016 10:02:18 GMT
Don't show placeholder for false, 0 value.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/aebbcc64
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/aebbcc64
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/aebbcc64

Branch: refs/heads/ignite-3262
Commit: aebbcc64cdc8fbf6269bc9c5147fe8c980a163dd
Parents: 61c106c
Author: Andrey Novikov <anovikov@apache.org>
Authored: Mon Jul 11 17:24:13 2016 +0700
Committer: Andrey Novikov <anovikov@apache.org>
Committed: Mon Jul 11 17:24:13 2016 +0700

----------------------------------------------------------------------
 .../app/modules/form/field/bs-select-placeholder.directive.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/aebbcc64/modules/web-console/src/main/js/app/modules/form/field/bs-select-placeholder.directive.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/app/modules/form/field/bs-select-placeholder.directive.js
b/modules/web-console/src/main/js/app/modules/form/field/bs-select-placeholder.directive.js
index 035fed4..83f438d 100644
--- a/modules/web-console/src/main/js/app/modules/form/field/bs-select-placeholder.directive.js
+++ b/modules/web-console/src/main/js/app/modules/form/field/bs-select-placeholder.directive.js
@@ -28,12 +28,13 @@ export default ['bsSelect', [() => {
 
             const value = ngModel.$viewValue;
 
-            if (value && (!attrs.multiple || value.length))
-                $element.removeClass('placeholder');
-            else {
+            if (_.isNil(value) || (attrs.multiple && !value.length)) {
                 $element.html(attrs.placeholder);
+
                 $element.addClass('placeholder');
             }
+            else
+                $element.removeClass('placeholder');
         };
     };
 


Mime
View raw message