aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIgor Minar2011-08-14 03:24:09 -0700
committerIgor Minar2011-08-19 00:59:44 -0700
commit4c8eaa1eb05ba98d30ff83f4420d6fcd69045d99 (patch)
treedc2cf6febf4af2dc081e81355451fc728c792e69 /src
parent4ba35eb97e8b7b9cf255e556fa0b86c892e76b1b (diff)
downloadangular.js-4c8eaa1eb05ba98d30ff83f4420d6fcd69045d99.tar.bz2
refactor(jqLite): remove jqLite show/hide support
it turns out that even with our tricks, jqLite#show is not usable in practice and definitely not on par with jQuery. so rather than introducing half-baked apis which introduce issues, I'm removing them. I also removed show/hide uses from docs, since they are not needed. Breaks jqLite.hide/jqLite.show which are no longer available.
Diffstat (limited to 'src')
-rw-r--r--src/Angular.js1
-rw-r--r--src/directives.js4
-rw-r--r--src/jqLite.js28
3 files changed, 2 insertions, 31 deletions
diff --git a/src/Angular.js b/src/Angular.js
index c26b799a..60f6e868 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -64,7 +64,6 @@ var _undefined = undefined,
$boolean = 'boolean',
$console = 'console',
$date = 'date',
- $display = 'display',
$element = 'element',
$function = 'function',
$length = 'length',
diff --git a/src/directives.js b/src/directives.js
index 64a06359..70398c81 100644
--- a/src/directives.js
+++ b/src/directives.js
@@ -738,7 +738,7 @@ angularDirective("ng:class-even", ngClass(function(i){return i % 2 === 1;}));
angularDirective("ng:show", function(expression, element){
return function(element){
this.$onEval(function(){
- toBoolean(this.$eval(expression)) ? element.show() : element.hide();
+ element.css('display', toBoolean(this.$eval(expression)) ? '' : 'none');
}, element);
};
});
@@ -779,7 +779,7 @@ angularDirective("ng:show", function(expression, element){
angularDirective("ng:hide", function(expression, element){
return function(element){
this.$onEval(function(){
- toBoolean(this.$eval(expression)) ? element.hide() : element.show();
+ element.css('display', toBoolean(this.$eval(expression)) ? 'none' : '');
}, element);
};
});
diff --git a/src/jqLite.js b/src/jqLite.js
index 3d7319a8..f8cd9a1f 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -47,8 +47,6 @@
* - [text()](http://api.jquery.com/text/)
* - [trigger()](http://api.jquery.com/trigger/)
* - [eq()](http://api.jquery.com/eq/)
- * - [show()](http://api.jquery.com/show/)
- * - [hide()](http://api.jquery.com/hide/)
*
* ## Additionally these methods extend the jQuery and are available in both jQuery and jQuery lite
* version:
@@ -456,32 +454,6 @@ forEach({
return element.getElementsByTagName(selector);
},
- hide: function(element) {
- if (element.style) {
- if(element.style.display !=="none" && !JQLiteData(element,"olddisplay")) {
- JQLiteData( element, "olddisplay", element.style.display);
- }
- element.style.display = "none";
- }
- },
-
- show: function(element) {
- if(element.style) {
- var display = element.style.display;
- if ( display === "" || display === "none" ) {
-
- // restore the original value overwritten by hide if present or default to nothing (which
- // will let browser correctly choose between 'inline' or 'block')
- element.style.display = JQLiteData(element, "olddisplay") || "";
-
- // if the previous didn't make the element visible then there are some cascading rules that
- // are still hiding it, so let's default to 'block', which might be incorrect in case of
- // elmenents that should be 'inline' by default, but oh well :-)
- if (!isVisible([element])) element.style.display = "block";
- }
- }
- },
-
clone: JQLiteClone
}, function(fn, name){
/**