Skip to content

Toggle button is broken in the Chrome version 41.0.2272.118 m #256

Open
@ilyassa

Description

@ilyassa

Chrome version 41.0.2272.118 m

window.getComputedStyle returns rational numbers (not rounding numbers). For this reason toggle button doesn't close a menu from the left side. I didn't check the right side menu.

When we call the public methd state, fromLeft property gets incorrect result from the action.translate.get.matrix(4)

        this.state = function() {
            var state,
                fromLeft = action.translate.get.matrix(4);
            if (fromLeft === settings.maxPosition) {
                state = 'left';
            } else if (fromLeft === settings.minPosition) {
                state = 'right';
            } else {
                state = 'closed';
            }
            return {
                state: state,
                info: cache.simpleStates
            };
        };

Temporary workaround:

                    matrix: function(index) {

                        if( !utils.canTransform() ){
                            return parseInt(settings.element.style.left, 10);
                        } else {
                            var matrix = win.getComputedStyle(settings.element)[cache.vendor+'Transform'].match(/\((.*)\)/),
                                ieOffset = 8;
                            if (matrix) {
                                matrix = matrix[1].split(',');
                                if(matrix.length===16){
                                    index+=ieOffset;
                                }
                                // todo: round matrix instead of parsing
                                //return parseInt(matrix[index], 10);
                                return Math.round(matrix[index]);
                            }
                            return 0;
                        }
                    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions