Skip to content

IE9 Issue on the Morph button #1

Open

Description

@impulsedl

uiMorphingButton_fixed.js

Error in console IE9:
Line: 90
Error: Unable to get property 'target' of undefined or null reference

help to fix

Activity

  1. scriptype commented on May 23, 2014

    @scriptype

    starting from line 115:

    if( support.transitions ) {
        this.contentEl.addEventListener( transEndEventName, onEndTransitionFn );
    }
    else {
        onEndTransitionFn();
    }

    So when there's no support for transitions, the onEndTransitionFn is still being called yet without an event parameter.

    And when you look at the line 90, there's:

    if( ev.target !== this ) return false;

    So the ev being undefined -result of lack of an event param-, it causes IE9 (apparently doesn't provide transitions(?)) to break things.

  2. stiwariexpress commented on May 27, 2014

    @stiwariexpress

    @impulsedl

    did you success in IE9 as, I am having the same issue... IE9 is not behaving good to me. can this has any way to work on IE9? looking forward to resolve this issue.

  3. impulsedl commented on May 28, 2014

    @impulsedl
    Author

    Any update for this plugin,
    is there any solution to make this work in IE9 or any alternate solution, please suggest

  4. stiwariexpress commented on Jun 6, 2014

    @stiwariexpress

    Hope someone is working for IE9 issues to fix..
    On May 28, 2014 10:42 PM, "impulsedl" notifications@github.com wrote:

    Any update for this plugin,
    is there any solution to make this work in IE9 or any alternate solution,
    please suggest

    —
    Reply to this email directly or view it on GitHub
    #1 (comment)
    .

  5. maddy2get commented on Aug 4, 2014

    @maddy2get

    Here is my quick fix:

    Update this function:

    UIMorphingButton.prototype._initEvents = function() {
            var self = this;
            // open
            this.button.addEventListener( 'click', function() { self.toggle(); } );
            // close
            if( this.options.closeEl !== '' ) {
                var closeEl = this.el.querySelector( this.options.closeEl );
                if( closeEl ) {
                    closeEl.addEventListener( 'click', function() { self.toggle(); } );
                }
            }
        }
    

    to this and it will work with IE9 without special effects

    UIMorphingButton.prototype._initEvents = function() {
            var self = this;
            // open
            this.button.addEventListener( 'click', function() { 
                if(support.transitions) {
                  self.toggle(); 
                } else {
                  $(self.el).addClass('active open'); 
    
                } 
            } );
            // close
            if( this.options.closeEl !== '' ) {
                var closeEl = this.el.querySelector( this.options.closeEl );
                if( closeEl ) {
                    closeEl.addEventListener( 'click', function() { 
                        if(support.transitions) {
                          self.toggle(); 
                        } else {
                          $(self.el).removeClass('active open'); 
                        } 
                    } );
                }
            }
        }
    

    Further more, this code makes UIMorphingButton.prototype.toggle function bit cleaner by removing support.transitions conditionals.

    I have used some jQuery functions in above code but can be easily replaced with classie.
    Let me know if it doesn't work.

    Cheers.

  6. vimmynegi commented on Sep 16, 2014

    @vimmynegi

    hey @maddy2get not working in IE 9

  7. stiwariexpress commented on Sep 20, 2014

    @stiwariexpress

    Tried it but unfortunately its not working :(

    On 16 September 2014 18:12, vimmynegi notifications@github.com wrote:

    hey @maddy2get https://github.com/maddy2get not working in IE 9

    —
    Reply to this email directly or view it on GitHub
    #1 (comment)
    .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions