function addOnReady($js) { if (is_object($js)) { $js = $js->getString(); } if (!$this->atk4_initialised) { return parent::addOnReady($js); } $this->api->template->append('document_ready', "\$.atk4(function(){ " . $js . "; });\n"); return $this; }
/** * Adds JS chain to DOM onReady event * * @param jQuery_Chain|string $js * * @return $this */ public function addOnReady($js) { if ($js instanceof jQuery_Chain) { $js = $js->getString(); } if (!$this->atk4_initialised) { return parent::addOnReady($js); } $this->app->template->append('document_ready', '$.atk4(function(){ ' . $js . "; });\n"); return $this; }