Created
October 28, 2008 13:52
-
-
Save collin/20377 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.resource('module'); | |
_('#module-filter') | |
.keyup(function() { | |
_.('#module-list') | |
.resource_view({ | |
filter: { | |
name: _(this).val() | |
} | |
}); | |
}); | |
_('#module-list') | |
.resource_view({ | |
resource: 'module' | |
,template: 'module.list' | |
}) | |
.delegate('click', 'li', function() { | |
_('#method-display') | |
.resource_view({ | |
filter: { | |
module_id: _(this).data('module').id; | |
} | |
}); | |
}); | |
_('#method-display') | |
.resource_view({ | |
resource: 'method' | |
,template: 'module.methods' | |
,filter: null | |
,empty: { | |
template: 'methods.blank' | |
,object: { | |
/*whatever's cool, maybe even allow for a | |
function that returns an object*/ | |
} | |
} | |
,paginate: { | |
per_page: 10 | |
,targets: [{ | |
selector: '#method-display .current-page' | |
,template: 'method.current_page' | |
},{ | |
selector: '#method-display method.pagination_controls' | |
,template: 'method.pagination_links' | |
,limit: 5 | |
}] | |
} | |
}) | |
.delegate('click', '.prev', function() { | |
_(this).previous_page(); | |
}) | |
.delegate('click', '.next', function() { | |
_(this).next_page(); | |
}) | |
.delegate('click', 'a.page', function(e) { | |
_(this).jump_to_page(e.target.href); | |
e.preventDefault(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment