From dc7710cc659bd799a1d9811c782790619aa9ac74 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 26 Nov 2013 20:08:38 +0800 Subject: [PATCH] description and tags for gallery fixed --- .../gallery/app/assets/javascripts/gallery.js | 10 +++++----- .../panel/gallery/back_end/album_images_controller.rb | 2 +- .../views/panel/gallery/back_end/albums/show.html.erb | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vendor/built_in_modules/gallery/app/assets/javascripts/gallery.js b/vendor/built_in_modules/gallery/app/assets/javascripts/gallery.js index 8c113839..de2d501c 100644 --- a/vendor/built_in_modules/gallery/app/assets/javascripts/gallery.js +++ b/vendor/built_in_modules/gallery/app/assets/javascripts/gallery.js @@ -81,6 +81,7 @@ $(function() { obj = photosData.filter(function(a) { return a.id == image_id; })[0]; + switch($e.attr("for")){ case "description": if(obj.description){ @@ -91,6 +92,10 @@ $(function() { } instance.find("input[type=hidden]").val(image_id); + instance.find("form").bind("ajax:success",function(evt, data, status){ + $.pageslide.close(); + photosData = data; + }) break; case "tags": instance.find('.tags-groups').cardCheck({ @@ -141,11 +146,6 @@ $(function() { } } - $('form[data-remote]').bind("ajax:success",function(evt, data, status){ - $.pageslide.close(); - photosData = data; - }) - var photosData = null; if($("#imgholder").length){ $.getJSON(window.location.pathname, function(json, textStatus) { diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/album_images_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/album_images_controller.rb index a5310f7d..95c26c06 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/album_images_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/album_images_controller.rb @@ -29,7 +29,7 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController def update_image image = AlbumImage.find(params[:image_id]) image.update_attributes(params[:album_image]) - image.save + image.save! @album = Album.find(image.album_id.to_s) @images = @album.album_images @image_content = [] diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb index 7437de93..5a55ba06 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb @@ -150,7 +150,7 @@ Description <% @site_valid_locales.each_with_index do |locale, i| %> - + <% end %>
Cancel