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

Make reload atomic #149

Merged
merged 1 commit into from
Apr 28, 2017
Merged

Make reload atomic #149

merged 1 commit into from
Apr 28, 2017

Conversation

romaninsh
Copy link
Member

Currently jsReload() contains 2 actions - replace content with spinner, then load new content and replace. This PR combines them into a single method call. This way if we pass some expression based on the content that is about to be reloaded, we won't loose it due to spinner.

$grid = $page->add('Grid');
$grid->menu->addItem('Complete Selected', new \atk4\ui\jsReload($grid->table, [
    'delete'=>$grid->addSelection()->jsChecked()
]));
var_dump($_GET);

jsChecked is cleared by spinner and passed as empty string into reloadView.

Copy link
Member

@DarkSide666 DarkSide666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not JS expert, but looks good to me.

@romaninsh romaninsh merged commit 4288901 into develop Apr 28, 2017
@romaninsh romaninsh deleted the feature/non-destructive-reload branch April 28, 2017 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants