mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
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:
parent
18f086fbd1
commit
a1f632c905
1 changed files with 14 additions and 0 deletions
|
@ -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'])) {
|
||||
|
|
Loading…
Add table
Reference in a new issue