Skip to content

Commit

Permalink
BUG Fix ModelAdmin search (fixes #8052)
Browse files Browse the repository at this point in the history
Broken by jQuery UI ajax behaviour in tabs, which compares
URLs to determine if the tab needs to be loaded via ajax.
This was always a brittle solution, and now broke alongside
our upgrade to jQuery UI 1.9 (specifically, with 2657a27).

The ajax behaviour is now globally disabled in favour of
having '.cms-panel-link' behaviour on the tabs, which
was already in place.
  • Loading branch information
chillu committed Dec 4, 2012
1 parent 0eab453 commit 0be51a9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions admin/javascript/LeftAndMain.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -923,14 +923,8 @@ jQuery.noConflict();
if(!this.data('uiTabs')) this.tabs({ if(!this.data('uiTabs')) this.tabs({
active: (activeTab.index() != -1) ? activeTab.index() : 0, active: (activeTab.index() != -1) ? activeTab.index() : 0,
beforeLoad: function(e, ui) { beforeLoad: function(e, ui) {
// Overwrite ajax loading to use CMS logic instead // Disable automatic ajax loading of tabs without matching DOM elements,
var makeAbs = $.path.makeUrlAbsolute, // determining if the current URL differs from the tab URL is too error prone.
baseUrl = $('base').attr('href'),
isSame = (makeAbs(ui.ajaxSettings.url, baseUrl) == makeAbs(document.location.href));

if(!isSame) $('.cms-container').loadPanel(ui.ajaxSettings.url);
$(this).tabs('select', ui.tab.index());

return false; return false;
}, },
activate: function(e, ui) { activate: function(e, ui) {
Expand Down

0 comments on commit 0be51a9

Please sign in to comment.