0

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;
        });
    }
}
4

0 に答える 0