* Merge randuin's changes
* Revert user/show changes * Move paginator js into separate file
This commit is contained in:
@@ -8,20 +8,3 @@
|
||||
//= require_self
|
||||
//= require_tree .
|
||||
|
||||
(function() {
|
||||
Danbooru.Paginator = {};
|
||||
Danbooru.Paginator.next_page = function() {
|
||||
if($('.paginator li span').parent().next().length != 0)
|
||||
{
|
||||
window.location = $('.paginator li span').parent().next().find('a').attr('href');
|
||||
}
|
||||
}
|
||||
|
||||
Danbooru.Paginator.prev_page = function() {
|
||||
if($('.paginator li span').parent().prev().length != 0)
|
||||
{
|
||||
window.location = $('.paginator li span').parent().prev().find('a').attr('href');
|
||||
console.log('logged')
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
22
app/assets/javascripts/paginator.js
Normal file
22
app/assets/javascripts/paginator.js
Normal file
@@ -0,0 +1,22 @@
|
||||
(function() {
|
||||
Danbooru.Paginator = {};
|
||||
Danbooru.Paginator.next_page = function() {
|
||||
if($('.paginator li span').parent().next().length != 0)
|
||||
{
|
||||
window.location = $('.paginator li span').parent().next().find('a').attr('href');
|
||||
}
|
||||
}
|
||||
|
||||
Danbooru.Paginator.prev_page = function() {
|
||||
if($('.paginator li span').parent().prev().length != 0)
|
||||
{
|
||||
window.location = $('.paginator li span').parent().prev().find('a').attr('href');
|
||||
console.log('logged')
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
$(document).ready(function() {
|
||||
key('right', function(){ Danbooru.Paginator.next_page() });
|
||||
key('left', function(){ Danbooru.Paginator.prev_page() });
|
||||
})
|
||||
@@ -111,6 +111,4 @@
|
||||
|
||||
$(document).ready(function() {
|
||||
Danbooru.Post.initialize_all();
|
||||
key('right', function(){ Danbooru.Paginator.next_page() });
|
||||
key('left', function(){ Danbooru.Paginator.prev_page() });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user