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
SwapView element #183
Comments
I am adding this comment to discuss various ideas/issues about SwapView.
|
I think the idea was actually to make it a separated component that connects to a ViewStack. The reason for that was to allow any layout position without constraints. |
I don't think we support any form of inheritance here (@wkeese can confirm if needed). Another possibility is having ViewStack CSS modified to do: .d-view-stack, .d-swap-view {
} instead of just .d-view-stack {
} Not sure which one is best. |
OK makes sense. |
IIRC we support having multiple baseClasses for a Widget. There might be some bugs though, but at least it worked in dijit. I guess my comment is irrelevant if SwapView is "a separated component that connects to a ViewStack"... although I'm not sure what that means exactly. When rendering completes, is |
No, it does not appear so. However, the suggested solution does not provide any help for application developers who wants to override deliteful controls for what ever reasons. |
When talking about separate components I was talking about the page indicator not the SwapView. |
Right. In that case I guess the solution of @edurocher of adding a second base class in your subclass is doing the trick? |
For my controls I solved it with definition like baseClass: 'd-view-stack d-swap-view' and it works well. If it is the right solution, that I have no idea :-) |
That was my first idea too, then I looked at existing baseClass usages and I found things like this: domClass.toggle(this, this.baseClass + "-disabled", this.disabled); (in https://github.com/ibm-js/deliteful/blob/master/StarRating.js#L108, but there are many other examples in deliteful) which made me think baseClass was supposed to be only one class (even though that code probably works if the widget's "real" base class is last in the list, but that seems a little fragile). In any case it is useful to discuss this and clarify (and maybe also document?). |
OK, nevermind, I guess /**
* Root CSS class of the widget (ex: "d-text-box")
* @member {string}
* @protected
*/
baseClass: "", |
Here is some preliminary work: edurocher@19c04db. Just the swap interaction with a very simple sample for now (and no tests yet). |
And now a first shot at the ViewIndicator: edurocher@e535d81. |
Merged #398. |
Implements ibm-js#183, but tests TBD.
We need to be able to swap from a view to another, possibly using ViewStack. There should be an indicator.
The text was updated successfully, but these errors were encountered: