description and tags for gallery fixed
This commit is contained in:
parent
eb4cf1d165
commit
dc7710cc65
|
@ -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) {
|
||||
|
|
|
@ -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 = []
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
<legend>Description</legend>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<label><%= I18nVariable.from_locale(locale) %></label>
|
||||
<textarea rows="10" name="gallery_image[description_translations][<%= locale %>]" for="<%= locale %>"></textarea>
|
||||
<textarea rows="10" name="album_image[description_translations][<%= locale %>]" for="<%= locale %>"></textarea>
|
||||
<% end %>
|
||||
<div class="form-actions">
|
||||
<a href="javascript:$.pageslide.close()" class="btn btn-small">Cancel</a>
|
||||
|
|
Loading…
Reference in New Issue