Commit e4efb43a authored by Ivan Tyagov's avatar Ivan Tyagov

When renaming tab catch ENTER and use it for rename rather than submit whole main ERP5 form.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40951 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 108c65c7
......@@ -127,15 +127,19 @@
\n
<div id="rename_tab_dialog" \n
tal:condition="active_knowledge_pad"\n
class="toggable_dialog">\n
class="toggable_dialog"\n
tal:define="active_knowledge_pad_relative_url active_knowledge_pad/getRelativeUrl">\n
<h3 i18n:translate="" i18n:domain="ui"> Rename tab </h3>\n
<form action="">\n
<div>\n
<span i18n:translate="" i18n:domain="ui">Tab name</span>:\n
<input type="text"\n
id="new_knowledge_pad_title"\n
name="knowledge_pad_title"\n
tal:attributes="value active_knowledge_pad/getTitle"/><br/><br/>\n
tal:attributes="value active_knowledge_pad/getTitle;\n
onkeypress string:return renameKnowledgePadToServerOnEnter(event,\n
\'rename_tab_dialog\',\'active_knowledge_pad_title\',\n
\'new_knowledge_pad_title\',\'${active_knowledge_pad_relative_url}\');"/>\n
<br/>\n
<br/>\n
<button type="button"\n
i18n:translate="" \n
i18n:domain="ui"\n
......@@ -144,16 +148,12 @@
i18n:translate="" \n
i18n:domain="ui"\n
id="rename_tab_dialog_rename_button"\n
tal:attributes="onclick python: \'renameKnowledgePadToServer(\n
\\\'rename_tab_dialog\\\',\n
\\\'active_knowledge_pad_title\\\',\n
\\\'new_knowledge_pad_title\\\',\n
\\\'%s\\\')\' %active_knowledge_pad.getRelativeUrl()">\n
tal:attributes="onclick string:renameKnowledgePadToServer(\n
\'rename_tab_dialog\',\'active_knowledge_pad_title\',\n
\'new_knowledge_pad_title\',\'${active_knowledge_pad_relative_url}\');">\n
Rename \n
</button>\n
</div>\n
</form>\n
</div>\n
</tal:block>\n
\n
\n
......
......@@ -12,7 +12,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts91117034.62</string> </value>
<value> <string>ts91191957.42</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -311,6 +311,15 @@ function removeKnowledgePadFromServer(knowledge_pad_relative_url, mode, base_pat
}\n
}\n
\n
function renameKnowledgePadToServerOnEnter(event, dialog_id, title_id, \n
input_id, knowledge_pad_relative_url){\n
if(event.keyCode == 13){\n
renameKnowledgePadToServer(dialog_id, title_id, input_id, knowledge_pad_relative_url);\n
return false;\n
}\n
return true;\n
}\n
\n
function renameKnowledgePadToServer(dialog_id, title_id, \n
input_id, knowledge_pad_relative_url){\n
if (is_knowledge_template_used){\n
......@@ -433,7 +442,7 @@ MochiKit.DOM.addLoadEvent(initialize);\n
</item>
<item>
<key> <string>size</string> </key>
<value> <int>15998</int> </value>
<value> <int>16302</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
634
\ No newline at end of file
635
\ 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