get a post component by any of its attributes

v1.18.x
psychobunny 10 years ago
parent 1df20465ed
commit 8fcdae7f17

@ -5,7 +5,7 @@ var components = components || {};
(function() { (function() {
components.core = { components.core = {
'post': function(name, value) { 'post': function(name, value) {
return $('[data-' + name + '="' + value + '"]'); return value ? $('[data-' + name + '="' + value + '"]') $('[data-' + name + ']');
}, },
'post/content': function(pid) { 'post/content': function(pid) {
var el = components.core.post('pid', pid).find('[component="post/content"]'); var el = components.core.post('pid', pid).find('[component="post/content"]');

Loading…
Cancel
Save