use different selector rather than hardcoding url

This commit is contained in:
Daku 2014-03-08 15:20:50 +00:00
parent ddb6d32e29
commit 258fda188e

View file

@ -19,8 +19,8 @@ $(function() {
} }
//Generate a random seed when using order:random //Generate a random seed when using order:random
$('form[action="/shimmie/post/list"]').submit(function(e){ $('form > input[placeholder="Search"]').parent().submit(function(e){
var input = $('form[action="/shimmie/post/list"] input[name=search]'); var input = $('form > input[placeholder="Search"]');
var tagArr = input.val().split(" "); var tagArr = input.val().split(" ");
var rand = (($.inArray("order:random", tagArr) + 1) || ($.inArray("order=random", tagArr) + 1)) - 1; var rand = (($.inArray("order:random", tagArr) + 1) || ($.inArray("order=random", tagArr) + 1)) - 1;