Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Fomantic-UI tab render from View/App to VirtualPage #2190

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,6 @@ public function terminate($output = ''): void
}

$this->outputResponseJson($output);
} elseif ($this->hasRequestQueryParam('__atk_tab') && $type === 'text/html') {
$output = $this->getTag('script', [], '$(function () {' . $output['atkjs'] . '});')
. $output['html'];

$this->outputResponseHtml($output);
} elseif ($type === 'text/html') {
$this->outputResponseHtml($output);
} else {
Expand Down
14 changes: 0 additions & 14 deletions src/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -658,19 +658,6 @@ public function render(): string
. $this->renderTemplateToHtml();
}

/**
* This method is to render view to place inside a Fomantic-UI Tab.
*/
public function renderToTab(): array
{
$this->renderAll();

return [
'atkjs' => $this->getJs()->jsRender(),
'html' => $this->renderTemplateToHtml(),
];
}

/**
* Render View using JSON format.
*/
Expand Down Expand Up @@ -775,7 +762,6 @@ public function js($when = false, $action = null, $selector = null): ?JsExpressi

/**
* Create Vue.js instance.
* Vue.js instance can be created from Atk4\Ui\View.
*
* Component managed and defined by atk does not need componentDefinition variable name
* because these are already loaded within the atk js namespace.
Expand Down
5 changes: 4 additions & 1 deletion src/VirtualPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ public function getHtml(): string
}

if ($this->getApp()->hasRequestQueryParam('__atk_tab')) {
$this->getApp()->terminateHtml($this->renderToTab());
$outputArr = $this->renderToJsonArr();
$output = $this->getApp()->getTag('script', [], '$(function () {' . $outputArr['atkjs'] . '});')
. $outputArr['html'];
$this->getApp()->terminateHtml($output);
}

// do not terminate if callback supplied (no cutting)
Expand Down
Loading