Relation diagrams:

- Localization
- Handle the resize of the window
- Aysnchronous load/reload
- Filtering of the result based on the class

SVN:trunk[3574]
This commit is contained in:
Denis Flaven
2015-05-05 08:04:23 +00:00
parent 7077879194
commit 7f1f1337fa
7 changed files with 344 additions and 51 deletions

View File

@@ -171,6 +171,7 @@ EOF;
var innerWidth = $(this).innerWidth() - 10;
$(this).find('.item').width(innerWidth);
});
$('.panel-resized').trigger('resized');
}
}
@@ -217,7 +218,7 @@ EOF;
},
beforeLoad: function( event, ui ) {
if ( ui.tab.data('loaded') && (ui.tab.attr('data-cache') == 'true')) {
event.preventDefault();
event.defaultPrevented = true;
return;
}
ui.panel.html('<div><img src="../images/indicator.gif"></div>');
@@ -297,6 +298,21 @@ EOF
$.bbq.pushState( state );
});
// refresh the hash when the tab is changed (from a JS script)
$('body').on( 'tabsactivate', '.ui-tabs', function(event, ui) {
var state = {};
// Get the id of this tab widget.
var id = $(ui.newTab).closest( 'div[id^=tabbedContent]' ).attr( 'id' );
// Get the index of this tab.
var idx = $(ui.newTab).prevAll().length;
// Set the state!
state[ id ] = idx;
$.bbq.pushState( state );
});
// Bind an event to window.onhashchange that, when the history state changes,
// iterates over all tab widgets, changing the current tab as necessary.
$(window).bind( 'hashchange', function(e)