diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-18 18:26:10 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-18 18:26:10 +0000 |
commit | 7e5bad993de613e5618a651a0f822f5e4fa0d941 (patch) | |
tree | 4c118ea12135887ff14a4917b21347a14f6e37fe /app/views/my | |
parent | c9a46950de1bbcd7e4b326dcc619ffacd4cac713 (diff) | |
download | redmine-7e5bad993de613e5618a651a0f822f5e4fa0d941.tar.gz redmine-7e5bad993de613e5618a651a0f822f5e4fa0d941.zip |
Removes most of the ajax stuff on my page layout.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10033 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/my')
-rw-r--r-- | app/views/my/_block.html.erb | 6 | ||||
-rw-r--r-- | app/views/my/page_layout.html.erb | 58 |
2 files changed, 9 insertions, 55 deletions
diff --git a/app/views/my/_block.html.erb b/app/views/my/_block.html.erb index bd08a4540..813eb2b88 100644 --- a/app/views/my/_block.html.erb +++ b/app/views/my/_block.html.erb @@ -1,11 +1,7 @@ <div id="block_<%= block_name.dasherize %>" class="mypage-box"> <div style="float:right;margin-right:16px;z-index:500;"> - <%= link_to_remote "", { - :url => { :action => "remove_block", :block => block_name }, - :complete => "removeBlock('block_#{block_name.dasherize}')" }, - :class => "close-icon" - %> + <%= link_to "", {:action => "remove_block", :block => block_name}, :method => 'post', :class => "close-icon" %> </div> <div class="handle"> diff --git a/app/views/my/page_layout.html.erb b/app/views/my/page_layout.html.erb index 8b6c2e8dd..a4d1888ba 100644 --- a/app/views/my/page_layout.html.erb +++ b/app/views/my/page_layout.html.erb @@ -1,53 +1,12 @@ -<script language="JavaScript"> -//<![CDATA[ -function recreateSortables() { - Sortable.destroy('list-top'); - Sortable.destroy('list-left'); - Sortable.destroy('list-right'); - - Sortable.create("list-top", {constraint:false, containment:['list-top','list-left','list-right'], dropOnEmpty:true, handle:'handle', onUpdate:function(){new Ajax.Request('<%= url_for(:controller => 'my', :action => 'order_blocks', :group => 'top') %>', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("list-top")})}, only:'mypage-box', tag:'div'}) - Sortable.create("list-left", {constraint:false, containment:['list-top','list-left','list-right'], dropOnEmpty:true, handle:'handle', onUpdate:function(){new Ajax.Request('<%= url_for(:controller => 'my', :action => 'order_blocks', :group => 'left') %>', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("list-left")})}, only:'mypage-box', tag:'div'}) - Sortable.create("list-right", {constraint:false, containment:['list-top','list-left','list-right'], dropOnEmpty:true, handle:'handle', onUpdate:function(){new Ajax.Request('<%= url_for(:controller => 'my', :action => 'order_blocks', :group => 'right') %>', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("list-right")})}, only:'mypage-box', tag:'div'}) -} - -function updateSelect() { - s = $('block-select') - for (var i = 0; i < s.options.length; i++) { - if ($('block_' + s.options[i].value)) { - s.options[i].disabled = true; - } else { - s.options[i].disabled = false; - } - } - s.options[0].selected = true; -} - -function afterAddBlock() { - recreateSortables(); - updateSelect(); -} - -function removeBlock(block) { - Effect.DropOut(block); - updateSelect(); -} -//]]> -</script> - <div class="contextual"> -<%= form_tag({:action => "add_block"}, :id => "block-form") do %> -<%= label_tag('block-select', l(:label_my_page_block)) %>: -<%= select_tag 'block', - content_tag('option') + options_for_select(@block_options), - :id => "block-select" %> -<%= link_to_remote l(:button_add), - {:url => { :action => "add_block" }, - :with => "Form.serialize('block-form')", - :update => "list-top", - :position => :top, - :complete => "afterAddBlock();" - }, :class => 'icon icon-add' - %> +<% if @block_options.present? %> + <%= form_tag({:action => "add_block"}, :id => "block-form") do %> + <%= label_tag('block-select', l(:label_my_page_block)) %>: + <%= select_tag 'block', + content_tag('option') + options_for_select(@block_options), + :id => "block-select" %> + <%= link_to l(:button_add), '#', :onclick => '$("block-form").submit()', :class => 'icon icon-add' %> + <% end %> <% end %> <%= link_to l(:button_back), {:action => 'page'}, :class => 'icon icon-cancel' %> </div> @@ -105,5 +64,4 @@ function removeBlock(block) { :url => { :action => "order_blocks", :group => "right" } %> -<%= javascript_tag "updateSelect()" %> <% html_title(l(:label_my_page)) -%> |