Auto-Switch, possible?

KahneFan - June 1, 2008 - 05:46
Project:Switchtheme
Version:6.x-1.0
Component:Code
Category:feature request
Priority:normal
Assigned:mrtoner
Status:needs work
Description

Is it possible to auto-switch when a theme is selected and not have the "switch" button?

#1

KahneFan - June 19, 2008 - 00:21

Any thoughts?

#2

sun - June 19, 2008 - 04:43

If you thought of a onChange-JavaScript-handler for the form select widget, then yes, that would be possible.
However, I don't have time to implement this right now, but would be available for reviewing (and committing) a patch.

#3

mrtoner - February 14, 2009 - 10:23
Assigned to:Anonymous» mrtoner
Status:active» needs review

Here it is. I added some <br> tags to keep the <select> from overrunning following blocks; there's probably a better way to do that.

AttachmentSize
switchtheme_autosubmit.patch 1.08 KB

#4

sun - February 14, 2009 - 12:45
Status:needs review» needs work

This needs to degrade if JavaScript is not available. Which means that a patch for this issue most likely does not touch the .module file at all. It just adds a new JavaScript file containing a Drupal.behavior that removes the submit button and attaches the event handler.

On a second thought, I'm not sure whether this will break the layout/functionality of existing sites that use SwitchTheme. Maybe it has to be configurable setting then. Or maybe a notice in the release notes is sufficient... Not sure about that yet.

 
 

Drupal is a registered trademark of Dries Buytaert.