Adding 'indicator' feature to AjaxHelper

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4267 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-01-06 22:09:27 +00:00
parent 18f086fbd1
commit a1f632c905

View file

@ -648,6 +648,20 @@ class AjaxHelper extends AppHelper {
*/
function __optionsForAjax($options = array()) {
if (isset($options['indicator'])) {
if (isset($options['loading'])) {
$options['loading'] .= "Element.show('{$options['indicator']}');";
} else {
$options['loading'] = "Element.show('{$options['indicator']}');";
}
if (isset($options['complete'])) {
$options['complete'] .= "Element.hide('{$options['indicator']}');";
} else {
$options['complete'] = "Element.hide('{$options['indicator']}');";
}
unset($options['indicator']);
}
$js_options = $this->_buildCallbacks($options);
if (!isset($js_options['asynchronous'])) {