Permalink
Browse files

Adding is.hidden

  • Loading branch information...
krasimir committed Mar 10, 2014
1 parent 81499de commit 8056d7bbca9dd72ec4a82d75c798d1c5fae17115
@@ -1,4 +1,4 @@
-/* version: 0.3.145, born: 10-2-2014 14:23 */
+/* version: 0.3.145, born: 10-2-2014 16:20 */
var Absurd = (function(w) {
var lib = {
api: {},
@@ -612,6 +612,10 @@ absurd.di.register('is', {
appended: function(selector) {
if(typeof selector == 'undefined') selector = this.host.html;
return qs(selector) ? true : false;
+ },
+ hidden: function(el) {
+ el = el || this.host.el;
+ return el.offsetParent === null;
}
});
absurd.di.register('router', {

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,4 +1,4 @@
-/* version: 0.3.145, born: 10-2-2014 14:23 */
+/* version: 0.3.145, born: 10-2-2014 16:20 */
var Organic = (function(w){
var o = {
helpers: {},
@@ -2,5 +2,9 @@ absurd.di.register('is', {
appended: function(selector) {
if(typeof selector == 'undefined') selector = this.host.html;
return qs(selector) ? true : false;
+ },
+ hidden: function(el) {
+ el = el || this.host.el;
+ return el.offsetParent === null;
}
});
@@ -19,4 +19,17 @@ describe("Testing components (is)", function() {
})();
});
+ it("should use is.hidden", function(done) {
+ absurd.component('TestingIsAppended', {
+ html: {
+ p: 'Test'
+ },
+ constructor: function(is) {
+ this.populate();
+ expect(is.hidden()).toBe(true);
+ done();
+ }
+ })();
+ });
+
});
View
@@ -1,6 +1,6 @@
{
"name": "absurd",
- "version": "0.3.145",
+ "version": "0.3.146",
"homepage": "http://absurdjs.com/",
"description": "CSS/HTML preprocessor. Check out krasimirtsonev.com/blog/article/AbsurdJS-fundamentals",
"main": "./index.js",
@@ -610,6 +610,10 @@ absurd.di.register('is', {
appended: function(selector) {
if(typeof selector == 'undefined') selector = this.host.html;
return qs(selector) ? true : false;
+ },
+ hidden: function(el) {
+ el = el || this.host.el;
+ return el.offsetParent === null;
}
});
absurd.di.register('router', {

0 comments on commit 8056d7b

Please sign in to comment.