Commit 008f2500 authored by Ivan Tyagov's avatar Ivan Tyagov

Use simply link for "Add gadgets" this way we can use popup style for adding a...

Use simply link for "Add gadgets" this way we can use popup style for adding a new gadget without a page refresh.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44388 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e7e47f6a
...@@ -88,8 +88,7 @@ ...@@ -88,8 +88,7 @@
<tal:block metal:define-macro="add_new_gadget"\n <tal:block metal:define-macro="add_new_gadget"\n
tal:define="active_knowledge_pad_relative_url active_knowledge_pad/getRelativeUrl;">\n tal:define="active_knowledge_pad_relative_url active_knowledge_pad/getRelativeUrl;">\n
<a tal:condition="not: isKnowledgePadTemplateUsed"\n <a tal:condition="not: isKnowledgePadTemplateUsed"\n
onclick="return addNewPad()"\n tal:attributes="href string:Base_viewGadgetListDialog?reset=1&amp;cancel_url=${cancel_url}&amp;mode=${mode}&amp;active_pad_relative_url=${active_knowledge_pad_relative_url}"\n
tal:attributes="onclick string: addNewPad(\'${cancel_url}\',\'${active_knowledge_pad_relative_url}\',\'${mode}\')"\n
title="Add gadgets"\n title="Add gadgets"\n
i18n:domain="ui"\n i18n:domain="ui"\n
i18n:attributes="title"\n i18n:attributes="title"\n
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</item> </item>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts99770782.61</string> </value> <value> <string>ts00370324.82</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -314,6 +314,11 @@ function loadPadFromServer(pad_relative_url, selected_pad_dom_id, mode){\n ...@@ -314,6 +314,11 @@ function loadPadFromServer(pad_relative_url, selected_pad_dom_id, mode){\n
// set new active pad\n // set new active pad\n
active_knowledge_pad_relative_url = pad_relative_url;\n active_knowledge_pad_relative_url = pad_relative_url;\n
\n \n
// update "Add Gadget" link\n
current_url = $("#add-gadgets").attr("href");\n
new_url = current_url.substring(0, current_url.indexOf("active_pad_relative_url=")+24)+active_knowledge_pad_relative_url\n
$("#add-gadgets").attr("href", new_url);\n
\n
//function metadataFetchFailed(meta){}\n //function metadataFetchFailed(meta){}\n
function handleServerSuccess(data){\n function handleServerSuccess(data){\n
body = data.body\n body = data.body\n
...@@ -328,15 +333,6 @@ function loadPadFromServer(pad_relative_url, selected_pad_dom_id, mode){\n ...@@ -328,15 +333,6 @@ function loadPadFromServer(pad_relative_url, selected_pad_dom_id, mode){\n
setTimeout("$(\'#loading-wrapper\').first().hide();", 250 );};\n setTimeout("$(\'#loading-wrapper\').first().hide();", 250 );};\n
}\n }\n
\n \n
function addNewPad(cancel_url, knowledge_pad_relative_url, mode){\n
// if it\'s first time we switch set active_knowledge_pad_relative_url\n
if(active_knowledge_pad_relative_url==\'\'){\n
active_knowledge_pad_relative_url = knowledge_pad_relative_url;\n
}\n
// redirect to add gadget dialog\n
window.location=add_new_gadget_form_id + "?reset=1&cancel_url="+cancel_url+"&active_pad_relative_url="+active_knowledge_pad_relative_url+"&mode="+mode; \n
}\n
\n
function addPadOnServerOnEnter(event, mode, cancel_url){\n function addPadOnServerOnEnter(event, mode, cancel_url){\n
/* Catch and submit form when ENTER is pressed */\n /* Catch and submit form when ENTER is pressed */\n
if(event.keyCode == 13){\n if(event.keyCode == 13){\n
...@@ -497,7 +493,7 @@ $(document).ready(initialize);\n ...@@ -497,7 +493,7 @@ $(document).ready(initialize);\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>18445</int> </value> <value> <int>18244</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
708 709
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment