toshi0383 / TVMLKitchen

Swifty TVML template manager with or without client-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modal presented TVML should be dismissed when it opens other TVML using template attribute

toshi0383 opened this issue · comments

TVML should be dismissed when presented modally, and opening other TVML.

Current Behavior

I can present a TVML modally like this. (Thanks a lot @steve228uk !)

Kitchen.serve(jsFile: "Sample.xml.js", type: .Modal)

Sample.xml.js has a button like this.

<button class="button" template="https://raw.githubusercontent.com/toshi0383/TVMLKitchen/master/SampleRecipe/Catalog.xml.js">

If this is clicked, kitchen.js presents the Catalog.xml.js behind the Sample.xml.js .

This should be pretty easy to do if we call the dismissTVMLModal() function before we pass the template to JS.

Do you think we should dismiss on actionIDs too, in this modal context ?

@toshi0383 I think it's probably worth letting the dev decide that because if they use the .Modal presentation style to show the next view it will show overlaid as expected (I think).

Agree.
So the dev can call Kitchen.dismissModal() in actionIDHandler to dismiss the modal view, right ?

Yeah that's what I've been doing with alert actions 😄