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

Button animations and interactivity #396

Open
tomasherceg opened this issue Jul 24, 2017 · 3 comments
Open

Button animations and interactivity #396

tomasherceg opened this issue Jul 24, 2017 · 3 comments

Comments

@tomasherceg
Copy link
Member

We have heard some complaints about the following scenario: "I need to run an animation on a button while a postback is running".

There are a several ways how to do this in DotVVM:

  • create a custom postback handler and applying it to the control (universal and preferred way)
  • attaching to beforePostback and afterPostback events using javascript (it can disable all buttons globally, or only the button which fired the postback, when used e.g. from a custom knockout binding)

To simplify the syntax, there are also several options:

  • ihnerit from the default Button control and create e.g. the AnimatedButton control
  • create a Decorator
  • create an active property (which can add a custom behavior to an existing control)
  • using server-side styles (which are not documented yet)

However, I agree that neither of the methods is simple.

I can imagine several solutions:

  • create a control in the DotVVM Contrib
  • prepare a generic postback handler that can run a script before or after the postback
  • prepare an active property which can apply a CSS class while a postback is running on the specific control (e.g. PostBack.IsBusyCssClass="processing")
@tomasherceg tomasherceg added this to the Version 1.2 milestone Jul 24, 2017
@djanosik
Copy link
Contributor

We should prefer simple solution that will not require users to write their own JavaScript. I think it's good enough to prepare some decorator or active property.

@exyi exyi modified the milestones: Version 2.0, Future Sep 26, 2017
@exyi
Copy link
Member

exyi commented Oct 29, 2017

I think that we should have

  • <dot:PostbackIsRunning CssClass='' - A postback handler that will attach a css to the control when the postback is running.
  • The PostBack.IsBusyCssClass="processing" - an active property that will attach the postback handler
  • _page.PostbackRunning a property that can be used in binding anywhere. We could also have _queue.PostbackRunningQueue [ == "MyPostbackGroup"] that would return a queue of the running postback.

@tomasherceg What do you think?

@quigamdev quigamdev modified the milestones: Future, Version 2.1 Jun 8, 2018
@tomasherceg
Copy link
Member Author

We should have a discussion about the right solution - I like PostBack.IsBusyCssClass for simple scenarios and full postback handler for all other scenarios.

@tomasherceg tomasherceg removed this from the Version 2.1 milestone Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants