Skip to content
This repository was archived by the owner on Apr 16, 2019. It is now read-only.
This repository was archived by the owner on Apr 16, 2019. It is now read-only.

I doubt that I found some bugs, but can not confirm... #931

Description

@zhyee

The first:
` showMask: function(text, value) {
if (!text) text = this.loadingText || "";
if (!value || typeof value !== "number") timeout = 15000; ?????this global parameter timeout is not defined and used??????
$.query("#afui_mask>h1").html(text);
$.query("#afui_mask").show();
this.showingMask = true;

        var self = this;
        //set another timeout to auto-hide the mask if something goes wrong, default is 15 sec
        setTimeout(function() {
            if(self.showingMask) {
                self.hideMask();
            }
        }, value);
    }`

The second:

` IE 10 fixes

        var href = theTarget.href,
            prefix = location.protocol + "//" + location.hostname + ":" + location.port + location.pathname;
        if (href.indexOf(prefix) === 0) {
            href = href.substring(prefix.length);
        }
        //empty links
        if (href === "#" || (href.indexOf("#") === href.length - 1) || (href.length === 0 && theTarget.hash.length === 0)) return e.preventDefault();

        //internal links
        //http urls
        var urlRegex=/^((http|https|file):\/\/)/;
        //only call prevent default on http/fileurls.  If it's a protocol handler, do not call prevent default.
        //It will fall through to the ajax call and fail
        if(theTarget.href.indexOf(":") !== -1 &&urlRegex.test(theTarget.href))
            e.preventDefault();

        var mytransition = theTarget.getAttribute("data-transition");
        if(!mytransition&&$(theTarget).closest("footer").length>0)
            mytransition="none";

        if(mytransition&&mytransition.indexOf(":dismiss")!==-1){
            return $.afui.dismissView(theTarget,mytransition);
        }
        href = theTarget.hash.length > 0 ? theTarget.hash : href;   ??????here href  shoude be theTarget.href ?????? 
        $.afui.loadContent(href, false, 0, mytransition, theTarget);
        return;`

Activity

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