Hybrid View

  1. #1
    Sencha Premium Member StuartAshworth's Avatar
    Join Date
    Feb 2009
    Location
    Glasgow, Scotland
    Posts
    358
    Vote Rating
    19
    StuartAshworth will become famous soon enough StuartAshworth will become famous soon enough

      0  

    Default [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 free email course Best Practices for Improving your Sencha Apps

    Learn Ext JS 6 with my new ebook - Ext JS 6: Getting Started. Use code "extjs6" for 33% off!

    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,608
    Vote Rating
    206
    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 dongryphon has much to be proud of

      0  

    Default

    Great bug report thanks! Fix applied
    Don Griffin
    Director of Engineering - 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