From 901cb92941ae99e3ca6649a246598e1e7df7ecdb Mon Sep 17 00:00:00 2001 From: psychobunny Date: Tue, 17 Mar 2015 13:52:32 -0400 Subject: [PATCH] if no args, get all components of that type --- public/src/components.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/src/components.js b/public/src/components.js index a31549e694..47a1023c27 100644 --- a/public/src/components.js +++ b/public/src/components.js @@ -5,7 +5,7 @@ var components = components || {}; (function() { components.core = { 'post': function(name, value) { - return value ? $('[data-' + name + '="' + value + '"]') $('[data-' + name + ']'); + return $('[data-' + name + '="' + value + '"]'); }, 'post/content': function(pid) { var el = components.core.post('pid', pid).find('[component="post/content"]'); @@ -24,7 +24,7 @@ var components = components || {}; components.get = function() { var args = Array.prototype.slice.call(arguments, 1); - if (components.core[arguments[0]]) { + if (components.core[arguments[0]] && args.length) { return components.core[arguments[0]].apply(this, args); } else { return $('[component="' + arguments[0] + '"]');