Fixes #28: Pool reording does not work
This commit is contained in:
@@ -38,13 +38,13 @@
|
||||
});
|
||||
$("ul#sortable").disableSelection();
|
||||
|
||||
$("div.pools div.edit form#ordering-form").submit(function(e) {
|
||||
$("div#c-pool-orders div#a-edit form#ordering-form").submit(function(e) {
|
||||
$.ajax({
|
||||
type: "put",
|
||||
url: e.target.action,
|
||||
data: $("#sortable").sortable("serialize") + "&" + $(e.target).serialize()
|
||||
});
|
||||
return false;
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -11,25 +11,24 @@
|
||||
}
|
||||
|
||||
Danbooru.Post.initialize_image_resize = function() {
|
||||
var default_image_size = Danbooru.meta("default-image-size");
|
||||
var original_width = parseInt($("#image").data("original-width"));
|
||||
var medium_width = parseInt(Danbooru.meta("config-medium-width"));
|
||||
var large_width = parseInt(Danbooru.meta("config-large-width"));
|
||||
|
||||
console.log("original-width=%o medium-width=%o", original_width, medium_width);
|
||||
|
||||
if ((default_image_size === "medium") && (original_width > medium_width)) {
|
||||
$("#medium-file-link").trigger("click");
|
||||
} else if ((default_image_size === "large") && (original_width > large_width)) {
|
||||
$("#large-file-link").trigger("click");
|
||||
} else {
|
||||
$("#original-file-link").trigger("click");
|
||||
if ($("#c-posts #a-show").size() > 0) {
|
||||
var default_image_size = Danbooru.meta("default-image-size");
|
||||
var original_width = parseInt($("#image").data("original-width"));
|
||||
var medium_width = parseInt(Danbooru.meta("config-medium-width"));
|
||||
var large_width = parseInt(Danbooru.meta("config-large-width"));
|
||||
|
||||
if ((default_image_size === "medium") && (original_width > medium_width)) {
|
||||
$("#medium-file-link").trigger("click");
|
||||
} else if ((default_image_size === "large") && (original_width > large_width)) {
|
||||
$("#large-file-link").trigger("click");
|
||||
} else {
|
||||
$("#original-file-link").trigger("click");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Danbooru.Post.build_resize_function = function(size) {
|
||||
return function(e) {
|
||||
console.log("clicked " + size);
|
||||
Danbooru.Note.Box.descale_all();
|
||||
var $link = $(e.target);
|
||||
var $image = $("#image");
|
||||
|
||||
@@ -6,7 +6,4 @@ class PoolOrdersController < ApplicationController
|
||||
@pool = Pool.find(params[:pool_id])
|
||||
respond_with(@pool)
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
end
|
||||
|
||||
@@ -31,25 +31,25 @@ class PoolsController < ApplicationController
|
||||
|
||||
def create
|
||||
@pool = Pool.create(params[:pool])
|
||||
respond_with(@pool)
|
||||
respond_with(@pool, :notice => "Pool created")
|
||||
end
|
||||
|
||||
def update
|
||||
@pool = Pool.find(params[:id])
|
||||
@pool.update_attributes(params[:pool])
|
||||
respond_with(@pool)
|
||||
respond_with(@pool, :notice => "Pool updated")
|
||||
end
|
||||
|
||||
def destroy
|
||||
@pool = Pool.find(params[:id])
|
||||
@pool.destroy
|
||||
respond_with(@pool)
|
||||
respond_with(@pool, :notice => "Pool deleted")
|
||||
end
|
||||
|
||||
def revert
|
||||
@pool = Pool.find(params[:id])
|
||||
@version = PoolVersion.find(params[:version_id])
|
||||
@pool.revert_to!(@version)
|
||||
respond_with(@pool)
|
||||
respond_with(@pool, :notice => "Pool reverted")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user