From b04d845a5a3004b42d414b1588493abeba2a41db Mon Sep 17 00:00:00 2001 From: chris2tof Date: Thu, 29 Dec 2011 19:45:21 +0800 Subject: [PATCH] New rss.js from Harry and fix html form for assets --- app/assets/javascripts/rss.js | 4 ++-- app/views/admin/assets/_edit.html.erb | 10 +++++++--- app/views/admin/assets/_new.html.erb | 10 +++++++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/rss.js b/app/assets/javascripts/rss.js index 93b52140..a9d8ff32 100644 --- a/app/assets/javascripts/rss.js +++ b/app/assets/javascripts/rss.js @@ -429,7 +429,7 @@ modalWindow : function(settings,callbackFn){ tempwidth=maxwidth; rgWLeft=(rgmaskWidth-tempwidth)/2; } - tempwidth+=25; + tempwidth=parseInt(tempwidth)+25; $rss("#rgWindow").empty().show(); var closebtn = ""; if(closeBtn) @@ -508,7 +508,7 @@ modalWindowUpdate : function(settings,callbackFn){ tempwidth=maxwidth; rgWLeft=(rgmaskWidth-tempwidth)/2; } - tempwidth+=25; + tempwidth=parseInt(tempwidth)+25; $rss("#rgContent").empty(); $rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgContent").css("height",tempheight+"px").html(dhtml)}); $rss("#rgwindow_temp_div").remove(); diff --git a/app/views/admin/assets/_edit.html.erb b/app/views/admin/assets/_edit.html.erb index cc0a5c52..33f8131c 100644 --- a/app/views/admin/assets/_edit.html.erb +++ b/app/views/admin/assets/_edit.html.erb @@ -1,12 +1,16 @@

<%= t('editing_asset') %>

- <%= form_for @asset, :url => admin_asset_path(@asset), :html => {:id => 'ajaxForm', :multipart => true } do |f| %> + <%= form_for @asset, :url => admin_asset_path(@asset), :html => {:id => (is_html ? nil : 'ajaxForm'), :multipart => true } do |f| %> <%= f.error_messages %> <%= render :partial => "form", :locals => { :f => f } %>
- <%= link_back if is_html %> - <%= t(:update) %> + <% if is_html %> + <%= link_back %> + <%= f.submit t(:edit) %> + <% else %> + <%= t(:edit) %> + <% end %>
<% end %>
\ No newline at end of file diff --git a/app/views/admin/assets/_new.html.erb b/app/views/admin/assets/_new.html.erb index 2f997a11..9653af6f 100644 --- a/app/views/admin/assets/_new.html.erb +++ b/app/views/admin/assets/_new.html.erb @@ -1,12 +1,16 @@

<%= t('admin.new_asset') %>

- <%= form_for :asset, :url => admin_assets_path, :html => {:id => 'ajaxForm', :multipart => true }, :remote => true do |f| %> + <%= form_for :asset, :url => admin_assets_path, :html => {:id => (is_html ? nil : 'ajaxForm'), :multipart => true }, :remote => true do |f| %> <%= f.error_messages %> <%= render :partial => "form", :locals => { :f => f } %>
- <%= link_back if is_html %> - <%= t(:create) %> + <% if is_html %> + <%= link_back %> + <%= f.submit t(:create) %> + <% else %> + <%= t(:create) %> + <% end %>
<% end %>