升级到1.9.2后,jQuery UI选项卡中断

时间:2013-07-29 15:44:53

标签: jquery-ui jquery jquery-plugins

从jquery ui 1.6升级到1.9.2时,完美运行的标签功能现已破损!标签甚至不再可见。我检查了“好”和“破”页面之间的html标记,没有区别。

我有一个名为livequery的插件已过时,可能是导致此问题的原因。另外,我有一堆已弃用语法的绑定。我更新了所有已弃用的代码,尽管我知道如何基于jquery ui升级指南。虽然它没有奏效。面对这个问题的人可以分享他们的见解吗?我的“升级”jquery ui标签代码如下:

var Tabs = {
    init: function() {
        this.tabs = this.getTabs();
        this.on();
    },
    getTabs: function() {
        return jQuery(this.tabNode()).tabs({
            //ajaxOpts deprec
            //ajaxOptions: { global: false },
            beforeload: function(event, ui) {
                ui.ajaxSettings.global = false;
            },
            //select deprec
            //select: function() { jQuery('#waitmsg').activate() },
            option: function() {
                jQuery('#waitmsg').activate()
            },
            load: function() {
                jQuery('#waitmsg').hide()
            }
        });
    },
    tabNode: function() {
        return '#schools_tab > ul';
    },
    on: function() {
        this.onHighSchoolTab();
        this.onMidSchoolTab();
        this.onElemSchoolTab();
    },
    selected: function() {
        return this.tabs.data('selected.tabs');
    },
    refreshSelected: function() {
        jQuery(this.tabNode()).tabs('load', this.selected());
    },
    refreshIfSelected: function(index) {
        if (this.selected() == index) {
            jQuery(this.tabNode()).tabs('load', index);
        }
    },
    handleError: function(request) {
        eval(request.responseText);
    },
    // grab the last element of the id of an element.
    parseID: function(el) {
        return el.id.split('_').pop();
    },
    get: function(xfa, accountID, context) {
        $j.get('index.cfm', {
            fuseaction: xfa,
            accountID: accountID,
            context: context
        }, null, 'script');
    },
    post: function(href, data, callback) {
        if (!data) data = {};
        if (!callback) callback = null;
        $j.ajax({
            type: 'POST',
            href: href,
            data: data,
            dataType: 'script',
            success: callback,
            error: function(request) {
                // evaluate alert from error block, ignore errors
                try {
                    eval(request.responseText);
                } catch (err) {}
            }
        });
    },
    // define each tab binding
    onHighSchoolTab: function() {
        FormBinder.on('hischools');
        $j('#school_context input').livequery('click', function() {
            var context = $j(this).val();
            Tabs.get('hischools.list', Tabs.parseID(this), context);
            // Update the new note link to reflect the context change
            var link = $j('#new_schoollist').prop('href');
            $j('#new_schoollist').prop('href', link.replace(/context=\w+/, 'context=' + context));
        });
        $j('#show_all_schools').livequery('click', function() {
            Tabs.post(this.href, {}, function(data, textStatus) {
                $j('#show_all_schools').hide();
            });
            return false;
        });
        $j('#school_list a.delete').livequery('click', function() {
            if (confirm('Are you sure you want to delete this school?')) {
                Tabs.post(this.href);
            }
            return false;
        });
    }
}

0 个答案:

没有答案