Commit fdedb271 authored by Gabriel L. Oliveira's avatar Gabriel L. Oliveira

Make "Refresh" button correctly reset checked items

Make "Refresh" button correctly reset UNG listbox checked items,
  asynchronously.
parent ddad904d
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<a class="domain_selected"></a>\n <a class="domain_selected"></a>\n
<div tal:content="request/portal_status_message | nothing" class="portal_status_message"/>\n <div tal:content="request/portal_status_message | nothing" class="portal_status_message"/>\n
<tal:block tal:condition="python: not has_editor">\n <tal:block tal:condition="python: not has_editor">\n
<a i18n:translate="" i18n:domain="ui" tal:attributes="href python: request.get(\'URL\') + \'?unfoldDomain=%s.0&\' % domain_url + \n <a id="refresh_button" i18n:translate="" i18n:domain="ui" tal:attributes="href python: request.get(\'URL\') + \'?unfoldDomain=%s.0&\' % domain_url + \n
\'form_id=erp5_web_ung_layout&\' + \n \'form_id=erp5_web_ung_layout&\' + \n
\'list_selection_name=ung_document_list_selection&\' + \n \'list_selection_name=ung_document_list_selection&\' + \n
\'reset:int=1\'">Refresh</a>\n \'reset:int=1\'">Refresh</a>\n
......
...@@ -655,6 +655,7 @@ $().ready(function(){\n ...@@ -655,6 +655,7 @@ $().ready(function(){\n
});\n });\n
\n \n
function configureUNGSearch(data_script) {\n function configureUNGSearch(data_script) {\n
ung_listbox_updater_call = data_script\n
$(\'input#search_button\').click(function(event){\n $(\'input#search_button\').click(function(event){\n
event.preventDefault();\n event.preventDefault();\n
var searched_text = $(\'input[name="field_your_search_text"]\').val()\n var searched_text = $(\'input[name="field_your_search_text"]\').val()\n
...@@ -732,6 +733,9 @@ function separateUNGListboxGadgetFields() {\n ...@@ -732,6 +733,9 @@ function separateUNGListboxGadgetFields() {\n
// XXX: temporaly commented while developing\n // XXX: temporaly commented while developing\n
// TODO: analyze if this css is breaking layout of \'global scope\'\n // TODO: analyze if this css is breaking layout of \'global scope\'\n
// $("body").css("overflow", "hidden");\n // $("body").css("overflow", "hidden");\n
\n
// configure Refresh button\n
configureRefreshButton();\n
\n \n
// detach listbox-page-navigation\n // detach listbox-page-navigation\n
var gadget_navigation = data.find("div.listbox-footer div.listbox-page-navigation");\n var gadget_navigation = data.find("div.listbox-footer div.listbox-page-navigation");\n
...@@ -791,6 +795,26 @@ function separateUNGListboxGadgetFields() {\n ...@@ -791,6 +795,26 @@ function separateUNGListboxGadgetFields() {\n
});\n });\n
}\n }\n
\n \n
function configureRefreshButton() {\n
$(\'a#refresh_button\').click(function(event){\n
event.preventDefault();\n
// keep old function to call\n
var originalUpdater = updater;\n
// overwrite (shadowing) to change \'params\' param on the fly\n
updater = function() {\n
// \'params\' is the fifth param, so treat it\n
params = arguments[4]\n
params[\'reset:int\'] = 1\n
originalUpdater.apply(this, arguments);\n
}\n
// eval script\n
eval(ung_listbox_updater_call)\n
\n
// restore old function\n
updater = originalUpdater;\n
})\n
}\n
\n
function setPortalStatusMessage(status_message) {\n function setPortalStatusMessage(status_message) {\n
//display warning\n //display warning\n
status_message_tag = $(\'div.portal_status_message\')\n status_message_tag = $(\'div.portal_status_message\')\n
......
2011-09-21 gabriel.oliveira
* Make "Refresh" button correctly reset UNG listbox checked items, asynchronously
2011-07-01 gabriel.oliveira 2011-07-01 gabriel.oliveira
* Refactor to only load UNG document list when necessary * Refactor to only load UNG document list when necessary
......
386 387
\ 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