I've been trying to override Views' ajax_view.js for custom ajax functionality, so this seemed perfect. However, to my surprise, preprocess_views_view() (where Views puts its drupal_add_js() call runs after preprocess_page(), where JS Alter runs its hook. So the hook never sees the Views JS and therefore can't edit them.
I'm thinking there's not much that can be done here, but I do find it odd that it runs in this order -- shouldn't the view process before the page? -- and wondering if you've run into this and possibly found a workaround. (I guess there's always regexing $scripts, or just overriding the functions on the JS side.) Thanks!

Comments

mihai7221’s picture

Issue summary: View changes

I know it's super late to reply to this, but maybe someone will use this information sometime.

You can try to change the modules weight, more information here. The modules weight represents the order in which a module hooks are executed.