androbey Posted March 16, 2020 Share Posted March 16, 2020 Hi everybody, I am currently developing a configurable module (no ProcessModule). Some time ago I stumbled upon a forum post about using the VEX library in the backend. Now, I wanted to try this in my module. But with the example code I get an almost useless dialog: <?php //in init method $this->modules->get('JqueryUI')->use('vex'); //javascript ProcessWire.confirm('Are you sure you want to continue?', function() { //ok },function() { // canceled }); leads to following screen: There are no erros in console. I am using ProcessWire 3.0.148. Did I miss something or doing something wrong? Link to comment Share on other sites More sharing options...
bernhard Posted March 16, 2020 Share Posted March 16, 2020 It should work exactly like you said. Did you maybe not define a success callback? Then it would fallback to a regular confirm (though your screenshot does not like like a regular confirm...). https://github.com/processwire/processwire/blob/51629cdd5f381d3881133baf83e1bd2d9306f867/wire/templates-admin/scripts/main.js#L471 Check if "vex" is defined in your devtools console. There you can also try to show a vex alert like this: ProcessWire.alert('test'); Maybe your module is just not loaded? Link to comment Share on other sites More sharing options...
androbey Posted March 16, 2020 Author Share Posted March 16, 2020 This is strange. "vex" is defined and trying "ProcessWire.alert('test');" leads to a similiar result as in my screenshot above. Link to comment Share on other sites More sharing options...
androbey Posted March 16, 2020 Author Share Posted March 16, 2020 Ok I found the reason why my modal does not really look like it should but I don't know why the condition is not met: https://github.com/processwire/processwire/blob/master/wire/modules/Jquery/JqueryUI/JqueryUI.module#L44 $adminTheme obviously does not evaluate to true, hence the vex theme is not set. But as I am in admin backend, it should evaluate to true, shouldn't it? Link to comment Share on other sites More sharing options...
bernhard Posted March 18, 2020 Share Posted March 18, 2020 Ok, interesting. I had the same problem today. It's important that loading VEX happens in ready() not in init() of the module ? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now