1 function loadPanel(target, url) {
2 $.log('ajax', url, 'into', target);
3 $('.change-notification', $(target).parent()).fadeOut();
4 $(document).trigger('panel:unload', target);
8 success: function(data, textStatus) {
10 $(document).trigger('panel:load', target);
12 error: function(request, textStatus, errorThrown) {
13 $.log('ajax', url, target, 'error:', textStatus, errorThrown);
18 // Funkcja do tworzenia nowych paneli
19 function panel(load, unload) {
21 var eventId = Math.ceil(Math.random() * 1000000000);
23 unloadHandler = function(event, panel) {
24 if (self && self == panel) {
25 $(document).unbind('panel:unload.' + eventId);
32 $(document).one('panel:load', function(event, panel) {
34 $(document).bind('panel:unload.' + eventId, unloadHandler);
40 $('#panels').makeHorizPanel({});
41 $('#panels').css('top', ($('#header').outerHeight() ) + 'px');
43 $('.panel-toolbar select').change(function() {
44 loadPanel($('.panel-content', $(this).parent().parent()), $(this).val())