1. #1
    Sencha Premium Member
    Join Date
    Feb 2009
    Location
    Glasgow, Scotland
    Posts
    344
    Vote Rating
    12
    Stuart-SwarmOnline will become famous soon enough Stuart-SwarmOnline will become famous soon enough

      0  

    Default [BUG] toggleCls method throwing error [4.1 PR]

    [BUG] toggleCls method throwing error [4.1 PR]


    Hi Guys,

    Not sure what sort of reports you guys want as I know there are still known issues so ignore this if you have it covered!

    I have come across a small bug with the toggleCls method of the Ext.dom.AbstractElement class.

    It's just a small problem where the variable name doesn't match up.
    On line 11017 (of ext-all-debug.js):

    Code:
    dom.classList.toggle(name);
    ..should read:

    Code:
    dom.classList.toggle(className);
    Here's a drop-in override should anyone else come across this problem...

    Code:
    Ext.dom.AbstractElement.override({    toggleCls: Ext.supports.ClassList ?
            function (className) {
                var me = this,
                    dom = me.dom;
    
    
                if (dom) {
                    className = className.replace(/^\s+|\s+$/g, '');
                    if (className) {
                        dom.classList.toggle(className);
                    }
                }
    
    
                return me;
            } :
            function(className) {
                var me = this;
                return me.hasCls(className) ? me.removeCls(className) : me.addCls(className);
            }
    });
    Anyways, great work with the new release!

    Cheers
    Stuart
    Want to build better Sencha apps? Check out my new eBook Better Sencha Apps: Design Patterns & Best Practices

    Need help with Sencha development, code reviews or training? Get in touch!

    stuart@stuartashworth.com
    @StuartAshworth9

  2. #2
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,534
    Vote Rating
    184
    dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of

      0  

    Default


    Great bug report thanks! Fix applied
    Don Griffin
    Engineering Manager - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

Thread Participants: 1