Skip to content
This repository has been 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

Open
zhyee opened this issue Mar 14, 2017 · 0 comments
Open

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

zhyee opened this issue Mar 14, 2017 · 0 comments

Comments

@zhyee
Copy link

zhyee commented Mar 14, 2017

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;`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant