Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Namespaced classnames for showHide

  • Loading branch information...
commit 4f8cccc25dc26cda25609a6dccd247b4f7f076cc 1 parent 1889201
@ProLoser ProLoser authored
View
18 lib/angular-ui.js
@@ -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
@@ -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');
}
});
};
@@ -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
@@ -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');
}
});
};
@@ -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.
*
@@ -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');
}
});
};
View
2  lib/angular-ui.min.js
@@ -1,4 +1,4 @@
/**
* @module ui
* Bind Angular.js modules
- */angular.module("ui.filters",[]);angular.module("ui.directives",[]);angular.module("ui",["ui.filters","ui.directives"]);angular.module("ui.directives").directive("uiChosen",[function(){var options={},ajaxOptions={minLength:3,queryLimit:10,delay:100,chosenOptions:options,searchingText:"Searching...",noresultsText:"No results.",initialQuery:false};return function(scope,elm,attrs){var handler=scope.$eval(attrs.uiChosen);if(angular.isFunction(handler)){elm.ajaxChosen(ajaxOptions,handler)}else{elm.chosen(options)}}}]);angular.module("ui.directives").directive("uiJq",[function(){return function(scope,elm,attrs){if(attrs.uiOptions){elm[attrs.uiJq](scope.$eval(attrs.uiOptions))}else{elm[attrs.uiJq]()}}}]);angular.module("ui.directives").directive("uiKeypress",[function(){return function(scope,elm,attrs){var params=scope.$eval("["+attrs.uiKeypress+"]");params[1]=params[1]||angular.noop();elm.bind("keypress",function(event){if(event.keyCode==params[0]){params[1](event);scope.$apply()}})}}]);angular.module("ui.directives").directive("uiLinky",[function(){return function(scope,elm,attrs){var newElm,isLink=scope.$eval(attrs.uiLinky);if(isLink){newElm=angular.element("<a>");if(attr["ng-click"]){newElm.click(function(e){if(attr.href===undefined){e.preventDefault()}scope.$eval(attr["ng-click"])})}}else{newElm=angular.element("<span>")}delete attrs.href;delete attrs["ng-click"];delete attrs.uiLinky;newElm.attr(attrs);elm.html(newElm)}}]);angular.module("ui.directives").directive("uiRemove",[function(){return function(scope,elm,attrs){var remove,nextElm;scope.$watch(attrs.uiRemove,function(newVal,oldVal){if(newVal){nextElm=elm.next();if(elm["detach"]){elm.detach()}else{elm.remove()}}else{if(nextElm){nextElm.before(elm);nextElm=false}}})}}]);angular.module("ui.directives").directive("uiReset",[function(){return function(scope,elm,attrs){elm.wrap('<span class="ui-resetwrap" />').after('<a class="ui-reset" />').next().click(function(e){e.preventDefault();elm.val(null).trigger("change")})}}]);angular.module("ui.directives").directive("uiScrollfix",[function(){return function(scope,elm,attrs){if(!attrs.uiScrollfix){attrs.uiScrollfix=elm.offset().top}$(window).scroll(function(){if(!elm.hasClass("fixed")&&window.pageYOffset>attrs.uiScrollfix){elm.addClass("fixed")}else if(elm.hasClass("fixed")&&window.pageYOffset<attrs.uiScrollfix){elm.removeClass("fixed")}})}}]);angular.module("ui.directives").directive("uiShow",[function(){return function(scope,elm,attrs){scope.$watch(attrs.uiShow,function(newVal,oldVal){if(newVal){elm.addClass("show")}else{elm.removeClass("show")}})}}]);angular.module("ui.directives").directive("uiHide",[function(){return function(scope,elm,attrs){scope.$watch(attrs.uiHide,function(newVal,oldVal){if(newVal){elm.addClass("hide")}else{elm.removeClass("hide")}})}}]);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")}else{elm.removeClass("hide","show")}})}}]);angular.module("ui.filters").filter("highlight",function(){return function(text,filter){if(filter===undefined){return text}else{return text.replace(new RegExp(filter,"gi"),'<span class="match">$&</span>')}}});angular.module("ui.filters").filter("length",function(){return function(value){return value.length}});angular.module("ui.filters").filter("unique",function(){return function(items,key){var hashCheck={};for(i in items){var value=items[i][key];if(typeof hashCheck[value]!=="undefined"){delete items[i]}else{hashCheck[value]=true}}return items}});
+ */angular.module("ui.filters",[]);angular.module("ui.directives",[]);angular.module("ui",["ui.filters","ui.directives"]);angular.module("ui.directives").directive("uiChosen",[function(){var options={},ajaxOptions={minLength:3,queryLimit:10,delay:100,chosenOptions:options,searchingText:"Searching...",noresultsText:"No results.",initialQuery:false};return function(scope,elm,attrs){var handler=scope.$eval(attrs.uiChosen);if(angular.isFunction(handler)){elm.ajaxChosen(ajaxOptions,handler)}else{elm.chosen(options)}}}]);angular.module("ui.directives").directive("uiJq",[function(){return function(scope,elm,attrs){if(attrs.uiOptions){elm[attrs.uiJq](scope.$eval(attrs.uiOptions))}else{elm[attrs.uiJq]()}}}]);angular.module("ui.directives").directive("uiKeypress",[function(){return function(scope,elm,attrs){var params=scope.$eval("["+attrs.uiKeypress+"]");params[1]=params[1]||angular.noop();elm.bind("keypress",function(event){if(event.keyCode==params[0]){params[1](event);scope.$apply()}})}}]);angular.module("ui.directives").directive("uiLinky",[function(){return function(scope,elm,attrs){var newElm,isLink=scope.$eval(attrs.uiLinky);if(isLink){newElm=angular.element("<a>");if(attr["ng-click"]){newElm.click(function(e){if(attr.href===undefined){e.preventDefault()}scope.$eval(attr["ng-click"])})}}else{newElm=angular.element("<span>")}delete attrs.href;delete attrs["ng-click"];delete attrs.uiLinky;newElm.attr(attrs);elm.html(newElm)}}]);angular.module("ui.directives").directive("uiRemove",[function(){return function(scope,elm,attrs){var remove,nextElm;scope.$watch(attrs.uiRemove,function(newVal,oldVal){if(newVal){nextElm=elm.next();if(elm["detach"]){elm.detach()}else{elm.remove()}}else{if(nextElm){nextElm.before(elm);nextElm=false}}})}}]);angular.module("ui.directives").directive("uiReset",[function(){return function(scope,elm,attrs){elm.wrap('<span class="ui-resetwrap" />').after('<a class="ui-reset" />').next().click(function(e){e.preventDefault();elm.val(null).trigger("change")})}}]);angular.module("ui.directives").directive("uiScrollfix",[function(){return function(scope,elm,attrs){if(!attrs.uiScrollfix){attrs.uiScrollfix=elm.offset().top}$(window).scroll(function(){if(!elm.hasClass("fixed")&&window.pageYOffset>attrs.uiScrollfix){elm.addClass("fixed")}else if(elm.hasClass("fixed")&&window.pageYOffset<attrs.uiScrollfix){elm.removeClass("fixed")}})}}]);angular.module("ui.directives").directive("uiShow",[function(){return function(scope,elm,attrs){scope.$watch(attrs.uiShow,function(newVal,oldVal){if(newVal){elm.addClass("ui-show")}else{elm.removeClass("ui-show")}})}}]);angular.module("ui.directives").directive("uiHide",[function(){return function(scope,elm,attrs){scope.$watch(attrs.uiHide,function(newVal,oldVal){if(newVal){elm.addClass("ui-hide")}else{elm.removeClass("ui-hide")}})}}]);angular.module("ui.directives").directive("uiToggle",[function(){return function(scope,elm,attrs){scope.$watch(attrs.uiToggle,function(newVal,oldVal){if(newVal){elm.switchClass("ui-show","ui-hide")}else{elm.removeClass("ui-hide","ui-show")}})}}]);angular.module("ui.filters").filter("highlight",function(){return function(text,filter){if(filter===undefined){return text}else{return text.replace(new RegExp(filter,"gi"),'<span class="match">$&</span>')}}});angular.module("ui.filters").filter("length",function(){return function(value){return value.length}});angular.module("ui.filters").filter("unique",function(){return function(items,key){var hashCheck={};for(i in items){var value=items[i][key];if(typeof hashCheck[value]!=="undefined"){delete items[i]}else{hashCheck[value]=true}}return items}});
View
18 src/js/directives/showhide.js
@@ -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
@@ -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');
}
});
};
@@ -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
@@ -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');
}
});
};
@@ -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.
*
@@ -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');
}
});
};
Please sign in to comment.
Something went wrong with that request. Please try again.