New rss.js from Harry and fix html form for assets

This commit is contained in:
chris2tof 2011-12-29 19:45:21 +08:00
parent 7ebfe3a7f9
commit 0edad4f8c0
3 changed files with 16 additions and 8 deletions

View File

@ -430,7 +430,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)
@ -509,7 +509,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();

View File

@ -1,12 +1,16 @@
<div id='pop_up_content' class="main2">
<h1><%= t('editing_asset') %></h1>
<%= 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 } %>
<div class="button_bar">
<%= link_back if is_html %>
<a id='submit_button'><%= t(:update) %></a>
<% if is_html %>
<%= link_back %>
<%= f.submit t(:edit) %>
<% else %>
<a id='submit_button'><%= t(:edit) %></a>
<% end %>
</div>
<% end %>
</div>

View File

@ -1,12 +1,16 @@
<div id='pop_up_content' class="main2">
<h1><%= t('admin.new_asset') %></h1>
<%= 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 } %>
<div class="button_bar">
<%= link_back if is_html %>
<a id='submit_button'><%= t(:create) %></a>
<% if is_html %>
<%= link_back %>
<%= f.submit t(:create) %>
<% else %>
<a id='submit_button'><%= t(:create) %></a>
<% end %>
</div>
<% end %>
</div>