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