Skip to content
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

Adds JS hack to redirect back to CPCSS settings page on save #7

Merged
merged 2 commits into from
Jan 2, 2016

Conversation

mmikkel
Copy link
Contributor

@mmikkel mmikkel commented Dec 29, 2015

This is a proposed fix for issue #6 – basically a hack, but I believe it's the only/best way to do this currently, and also fairly safe (I use the same method in my CP Field Links plugin).

The fix uses jQuery to change the value of the hidden input field redirect from settings/plugins to setting/plugins/cpcss – in effect causing Craft to redirect to the Control Panel CSS settings page whenever the settings form is submitted successfully.

@mmikkel
Copy link
Contributor Author

mmikkel commented Jan 1, 2016

Upon request from @lindseydiloreto I just updated this PR to include a "Save and continue editing" option to the Save button (identical to the one found on Entry editing forms etc.). It looks like this: http://g.recordit.co/GVZdBtTRDq.gif

The Save button works like vanilla, and the key shortcut (Cmd/Ctrl+S) is mapped to "Save and continue" – exactly like similar button/submenus in the CP.

To be honest, I guess two Save buttons would be even more effective, however there would be issues w/ the responsive design, and there's also something to be said for consistency.

lindseydiloreto added a commit that referenced this pull request Jan 2, 2016
Adds JS hack to redirect back to CPCSS settings page on save
@lindseydiloreto lindseydiloreto merged commit f2cc827 into doublesecretagency:master Jan 2, 2016
@lindseydiloreto
Copy link
Collaborator

This works absolutely brilliantly!!!

Thanks @mmikkel, this is an excellent addition! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants