2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
24 * Defines "extensions" to standard Angular directives. Provides attributes that
\r
25 * can be included in HTML tags.
\r
27 * SYNTAX: ngx-enabled="true | false"
\r
29 * Enables / disables an element. Currently only supports button elements that
\r
30 * include the "button" element. This extension was added since the similar
\r
31 * standard Angular "ng-disabled" attribute does not handle buttons that use the
\r
34 * SYNTAX: ngx-visible="true | false"
\r
36 * Sets an element to visible / hidden. Different from ng-show / ng-hide as
\r
39 * ng-show=false or ng-hide=true - Element is completely hidden.
\r
41 * ngx-visible=false - Element is not displayed. However, a blank area is
\r
42 * displayed where the element would display if ngx-visible is set to true.
\r
45 appDS2.directive('ngxEnabled', function() {
\r
48 link : function(scope, element, attrs) {
\r
49 attrs.$observe("ngxEnabled", function(value) {
\r
50 if (attrs.attButton === "") {
\r
51 if (value === "true") {
\r
52 element.attr("btn-type", "primary").removeClass(
\r
53 "button--inactive").addClass("button--primary")
\r
54 .prop('disabled', false);
\r
56 element.attr("btn-type", "disabled").removeClass(
\r
57 "button--primary").addClass("button--inactive")
\r
58 .prop('disabled', true);
\r
66 appDS2.directive('ngxVisible', function() {
\r
69 link : function(scope, element, attrs) {
\r
70 attrs.$observe("ngxVisible", function(value) {
\r
71 if (value === "true") {
\r
72 element.css("visibility", "visible");
\r
74 element.css("visibility", "hidden");
\r