Commit fbd6193b authored by Yoshinori Okuji's avatar Yoshinori Okuji

2010-02-07 yo

* Clone bottom actions into the top.
* Reduce the amount of time when a vacant dialog is displayed.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32299 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent baf01ea0
...@@ -69,28 +69,34 @@ jQuery(function() {\n ...@@ -69,28 +69,34 @@ jQuery(function() {\n
var dialog = null;\n var dialog = null;\n
\n \n
var load = function(url, query) {\n var load = function(url, query) {\n
dialog.empty();\n //dialog.empty();\n
\n \n
// Some bogus animations for having the user to feel easier.\n // Some bogus animations for having the user to feel easier.\n
var animate = function() {\n var animate = function() {\n
var element = jQuery(\'p\', dialog);\n var element = jQuery(\'p.loading\', dialog);\n
if (element.length != 0) {\n if (element.length != 0) {\n
element.animate({opacity: 1}, 2000, \'linear\');\n //element.animate({opacity: 1}, 2000, \'linear\');\n
element.animate({opacity: 0}, 2000, \'linear\', animate);\n //element.animate({opacity: 0}, 2000, \'linear\', animate);\n
element.animate({color: "white"}, 2000, \'linear\');\n
element.animate({color: "black"}, 2000, \'linear\', animate);\n
}\n }\n
};\n };\n
jQuery(\'<p style="position: absolute; left: 0%; width: 100%; top: 30%; height: 40%; text-align: center; color: black; font-size: 32pt;">Loading...</p>\').appendTo(dialog);\n jQuery(\'<div class="loading" style="background-color: #AAAAAA; opacity: 0.5; position: absolute; left: 0%; width: 100%; top: 0%; height: 100%; transparent;"><p class="loading" style="position: absolute; left: 0%; width: 100%; top: 30%; height: 40%; text-align: center; color: black; font-size: 32pt;">Loading...</p></div>\').appendTo(dialog);\n
animate();\n animate();\n
\n \n
jQuery.post(url, query, function(data, textStatus, XMLHttpRequest) {\n jQuery.post(url, query, function(data, textStatus, XMLHttpRequest) {\n
if (textStatus == \'success\' || textStatus == \'notmodified\') {\n if (textStatus == \'success\' || textStatus == \'notmodified\') {\n
// Stop the animations above.\n // Stop the animations above.\n
dialog.empty();\n dialog.empty();\n
//jQuery(\'div.loading\', dialog).remove();\n
\n \n
dialog.html(jQuery(\'<div />\').append(data).find(\'form\'));\n dialog.html(jQuery(\'<div />\').append(data).find(\'form\'));\n
// XXX Get rid of unneeded stuff in JavaScript for now.\n // XXX Get rid of unneeded stuff in JavaScript for now.\n
jQuery(\'.bars, .breadcrumb, .logged_in_as\', dialog).remove();\n jQuery(\'.bars, .breadcrumb, .logged_in_as\', dialog).remove();\n
jQuery(\'[id]\', dialog).removeAttr(\'id\');\n jQuery(\'[id]\', dialog).removeAttr(\'id\');\n
\n
// Insert the same buttons as at the bottom into near the top.\n
jQuery(\'div.bottom_actions\', dialog).clone().insertAfter(jQuery(\'div.dialog_box\', dialog)).css(\'margin-bottom\', \'1em\');\n
\n \n
jQuery(\'input[type="image"], button.sort_button, .dialog_selector > button\', dialog).click(function(event) {\n jQuery(\'input[type="image"], button.sort_button, .dialog_selector > button\', dialog).click(function(event) {\n
event.preventDefault();\n event.preventDefault();\n
...@@ -162,16 +168,14 @@ jQuery(function() {\n ...@@ -162,16 +168,14 @@ jQuery(function() {\n
// Make sure that the dialog is present, and it is empty.\n // Make sure that the dialog is present, and it is empty.\n
if (dialog != null) {\n if (dialog != null) {\n
dialog.empty();\n dialog.empty();\n
if (!dialog.dialog(\'isOpen\'))\n dialog.destory();\n
dialog.dialog(\'open\');\n }\n
} else {\n
dialog = jQuery(\'<div id="dialog" />\').appendTo(\'body\');\n dialog = jQuery(\'<div id="dialog" />\').appendTo(\'body\');\n
dialog.dialog({ modal: true,\n dialog.dialog({ modal: true,\n
width: jQuery(window).width() * 0.8,\n width: jQuery(window).width() * 0.8,\n
height: jQuery(window).height() * 0.8,\n height: jQuery(window).height() * 0.8,\n
title: jQuery(\'label\', this.parentNode.parentNode).text()\n title: jQuery(\'label\', this.parentNode.parentNode).text()\n
});\n });\n
}\n
var form = jQuery(\'form#main_form\');\n var form = jQuery(\'form#main_form\');\n
var params = {};\n var params = {};\n
params[self.attr(\'name\')] = self.attr(\'value\');\n params[self.attr(\'name\')] = self.attr(\'value\');\n
......
2010-02-07 yo
* Clone bottom actions into the top.
* Reduce the amount of time when a vacant dialog is displayed.
2010-02-02 yo 2010-02-02 yo
* Initial import. * Initial import.
\ No newline at end of file
1 2
\ 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