How to make modal dialogs using Om or Reagent (and Bootstrap)

I am wondering how to show and hide modal dialog using Om or Reagent. Since my user interface is a function in state, show / hide should be started using a property in this state.

But for frameworks like Bootstrap, you need to call JavaScript to show / hide dialogs.

Is there a general solution to this problem?

+4
source share
2 answers

javascript jquery / Om Reagent. , . :

[(fn [shown]
       (if shown
        [:div.jumbotron.modal-background 
          {:on-click #(reset! popup-shown false)} 
          [:div.alert.alert-info
            [:div "Hello!"]]]
        [:div]))
   @popup-shown]
+6
+2

All Articles