Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2006-11-20 21:15:32

TangyTom
New member
Registered: 2006-11-20
Posts: 2

Stylist - how to prevent selecting multiple style classes (urgent)

Hey guys..

The Stylist plug-in allows a user to select one or more styles.

This is confusing to most of our clients and they wish they could just select a single style.

Nothing in the forum or tickets database to be found on this..

Any help urgently required due to presentation tomorrow, thanks a lot
Tom

Offline

#2 2006-11-21 06:00:27

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Stylist - how to prevent selecting multiple style classes (urgent)

Quick hack:

Index: stylist.js
===================================================================
--- stylist.js    (revision 608)
+++ stylist.js    (working copy)
@@ -192,6 +192,7 @@
         }
         else
         {
+          if (this._stylist_applyTo.className) return false;
           editor._stylistAddClasses(this._stylist_applyTo, this._stylist_applyTag, this._stylist_className);
         }
         return false;

Last edited by ray (2006-11-21 06:03:24)

Offline

#3 2006-11-21 17:44:49

TangyTom
New member
Registered: 2006-11-20
Posts: 2

Re: Stylist - how to prevent selecting multiple style classes (urgent)

Thanks for the hack.

However, it does not automatically deselect the old style but simply prevents selecting a second one.

With the amount of confusion we get from clients I would classify the inability of selecting just one style as a bug and not a feature request.

Of course it would be great if a simple setting would allow to define single or multi selection.

Thanks
Tom

Offline

#4 2006-11-23 06:53:15

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Stylist - how to prevent selecting multiple style classes (urgent)

If you really want to spoil this brilliant feature, try this:

Index: stylist.js
===================================================================
--- stylist.js    (revision 608)
+++ stylist.js    (working copy)
@@ -192,6 +192,7 @@
         }
         else
         {
+         if (this._stylist_applyTo.className) this._stylist_applyTo.className = '';
           editor._stylistAddClasses(this._stylist_applyTo, this._stylist_applyTag, this._stylist_className);
         }
         return false;

Offline

Board footer

Powered by FluxBB