Skip to content
This repository has been archived by the owner on May 5, 2018. It is now read-only.

Commit

Permalink
Namespaced classnames for showHide
Browse files Browse the repository at this point in the history
  • Loading branch information
Dean Sofer committed Mar 30, 2012
1 parent 1889201 commit 4f8cccc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
18 changes: 9 additions & 9 deletions lib/angular-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ angular.module('ui.directives').directive('uiScrollfix', [function() {
/**
* uiShow Directive
*
* Adds a 'show' class to the element instead of display:block
* Adds a 'ui-show' class to the element instead of display:block
* Created to allow tighter control of CSS without bulkier directives
*
* @param expression {boolean} evaluated expression to determine if the class should be added
Expand All @@ -191,9 +191,9 @@ angular.module('ui.directives').directive('uiShow', [function() {
return function(scope, elm, attrs) {
scope.$watch(attrs.uiShow, function(newVal, oldVal){
if (newVal) {
elm.addClass('show');
elm.addClass('ui-show');
} else {
elm.removeClass('show');
elm.removeClass('ui-show');
}
});
};
Expand All @@ -202,7 +202,7 @@ angular.module('ui.directives').directive('uiShow', [function() {
/**
* uiHide Directive
*
* Adds a 'hide' class to the element instead of display:block
* Adds a 'ui-hide' class to the element instead of display:block
* Created to allow tighter control of CSS without bulkier directives
*
* @param expression {boolean} evaluated expression to determine if the class should be added
Expand All @@ -212,9 +212,9 @@ angular.module('ui.directives').directive('uiHide', [function() {
return function(scope, elm, attrs) {
scope.$watch(attrs.uiHide, function(newVal, oldVal){
if (newVal) {
elm.addClass('hide');
elm.addClass('ui-hide');
} else {
elm.removeClass('hide');
elm.removeClass('ui-hide');
}
});
};
Expand All @@ -223,7 +223,7 @@ angular.module('ui.directives').directive('uiHide', [function() {
/**
* uiToggle Directive
*
* Adds a class 'show' if true, and a 'hide' if false to the element instead of display:block/display:none
* Adds a class 'ui-show' if true, and a 'ui-hide' if false to the element instead of display:block/display:none
* Created to allow tighter control of CSS without bulkier directives. This also allows you to override the
* default visibility of the element using either class.
*
Expand All @@ -234,9 +234,9 @@ angular.module('ui.directives').directive('uiToggle', [function() {
return function(scope, elm, attrs) {
scope.$watch(attrs.uiToggle, function(newVal, oldVal){
if (newVal) {
elm.switchClass('show', 'hide');
elm.switchClass('ui-show', 'ui-hide');
} else {
elm.removeClass('hide', 'show');
elm.removeClass('ui-hide', 'ui-show');
}
});
};
Expand Down
2 changes: 1 addition & 1 deletion lib/angular-ui.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions src/js/directives/showhide.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* uiShow Directive
*
* Adds a 'show' class to the element instead of display:block
* Adds a 'ui-show' class to the element instead of display:block
* Created to allow tighter control of CSS without bulkier directives
*
* @param expression {boolean} evaluated expression to determine if the class should be added
Expand All @@ -16,9 +16,9 @@ angular.module('ui.directives').directive('uiShow', [function() {
return function(scope, elm, attrs) {
scope.$watch(attrs.uiShow, function(newVal, oldVal){
if (newVal) {
elm.addClass('show');
elm.addClass('ui-show');
} else {
elm.removeClass('show');
elm.removeClass('ui-show');
}
});
};
Expand All @@ -27,7 +27,7 @@ angular.module('ui.directives').directive('uiShow', [function() {
/**
* uiHide Directive
*
* Adds a 'hide' class to the element instead of display:block
* Adds a 'ui-hide' class to the element instead of display:block
* Created to allow tighter control of CSS without bulkier directives
*
* @param expression {boolean} evaluated expression to determine if the class should be added
Expand All @@ -37,9 +37,9 @@ angular.module('ui.directives').directive('uiHide', [function() {
return function(scope, elm, attrs) {
scope.$watch(attrs.uiHide, function(newVal, oldVal){
if (newVal) {
elm.addClass('hide');
elm.addClass('ui-hide');
} else {
elm.removeClass('hide');
elm.removeClass('ui-hide');
}
});
};
Expand All @@ -48,7 +48,7 @@ angular.module('ui.directives').directive('uiHide', [function() {
/**
* uiToggle Directive
*
* Adds a class 'show' if true, and a 'hide' if false to the element instead of display:block/display:none
* Adds a class 'ui-show' if true, and a 'ui-hide' if false to the element instead of display:block/display:none
* Created to allow tighter control of CSS without bulkier directives. This also allows you to override the
* default visibility of the element using either class.
*
Expand All @@ -59,9 +59,9 @@ angular.module('ui.directives').directive('uiToggle', [function() {
return function(scope, elm, attrs) {
scope.$watch(attrs.uiToggle, function(newVal, oldVal){
if (newVal) {
elm.switchClass('show', 'hide');
elm.switchClass('ui-show', 'ui-hide');
} else {
elm.removeClass('hide', 'show');
elm.removeClass('ui-hide', 'ui-show');
}
});
};
Expand Down

0 comments on commit 4f8cccc

Please sign in to comment.